Private
Public Access
1
0

fix Credits

This commit is contained in:
Sebastian Unterschütz
2025-11-30 20:48:21 +01:00
parent 0c8f741bc5
commit fd2497a342
2 changed files with 3 additions and 3 deletions

View File

@@ -105,7 +105,7 @@ func handleWebSocket(w http.ResponseWriter, r *http.Request) {
for {
select {
case <-closeChan:
return // Client weg
return
case <-ticker.C:
InputLoop:
@@ -251,7 +251,7 @@ func generateFutureObjects(s *SimState, tick int, speed float64) ([]ActiveObstac
for _, def := range defaultConfig.Obstacles {
if def.ID == o.ID {
if def.CanTalk && len(def.SpeechLines) > 0 {
if s.RNG.NextFloat() > 0.7 { // 30% Wahrscheinlichkeit
if s.RNG.NextFloat() > 0.7 {
sIdx := int(s.RNG.NextRange(0, float64(len(def.SpeechLines))))
speech = def.SpeechLines[sIdx]
}