Private
Public Access
1
0

fix offline mode initialization for solo play
Some checks failed
Dynamic Branch Deploy / build-and-deploy (push) Failing after 1m38s

This commit is contained in:
Sebastian Unterschütz
2026-04-22 12:58:18 +02:00
parent de87b76005
commit 60581bf9ef
3 changed files with 5 additions and 5 deletions

View File

@@ -875,6 +875,7 @@ func (g *Game) resetForNewGame() {
g.lastRecvSeq = 0
// Spieler-State zurücksetzen
g.isOffline = false
g.scoreSubmitted = false
g.lastStatus = ""
g.correctionCount = 0

View File

@@ -113,7 +113,6 @@ func (g *Game) spawnOfflineChunk(atX float64) {
var pool []string
for id := range g.world.ChunkLibrary {
if id != "start" {
pool = append(pool)
pool = append(pool, id)
}
}

View File

@@ -36,11 +36,11 @@ func (g *Game) setupJavaScriptBridge() {
g.savePlayerName(playerName)
if mode == "solo" {
// Solo Mode - Auto-Start wartet auf Server
g.roomID = fmt.Sprintf("solo_%d", time.Now().UnixNano())
// Solo Mode - Jetzt standardmäßig OFFLINE
g.isHost = true
g.appState = StateLobby // Warte auf Server Auto-Start
log.Printf("🎮 Solo-Spiel gestartet: %s (warte auf Server)", playerName)
g.startOfflineGame()
log.Printf("🎮 Solo-Spiel OFFLINE gestartet: %s", playerName)
return nil
} else if mode == "coop" && len(args) >= 5 {
// Co-op Mode - in die Lobby
roomID := args[2].String()