fix offline mode initialization for solo play
Some checks failed
Dynamic Branch Deploy / build-and-deploy (push) Failing after 1m38s
Some checks failed
Dynamic Branch Deploy / build-and-deploy (push) Failing after 1m38s
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user