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
|
g.lastRecvSeq = 0
|
||||||
|
|
||||||
// Spieler-State zurücksetzen
|
// Spieler-State zurücksetzen
|
||||||
|
g.isOffline = false
|
||||||
g.scoreSubmitted = false
|
g.scoreSubmitted = false
|
||||||
g.lastStatus = ""
|
g.lastStatus = ""
|
||||||
g.correctionCount = 0
|
g.correctionCount = 0
|
||||||
|
|||||||
@@ -113,7 +113,6 @@ func (g *Game) spawnOfflineChunk(atX float64) {
|
|||||||
var pool []string
|
var pool []string
|
||||||
for id := range g.world.ChunkLibrary {
|
for id := range g.world.ChunkLibrary {
|
||||||
if id != "start" {
|
if id != "start" {
|
||||||
pool = append(pool)
|
|
||||||
pool = append(pool, id)
|
pool = append(pool, id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,11 +36,11 @@ func (g *Game) setupJavaScriptBridge() {
|
|||||||
g.savePlayerName(playerName)
|
g.savePlayerName(playerName)
|
||||||
|
|
||||||
if mode == "solo" {
|
if mode == "solo" {
|
||||||
// Solo Mode - Auto-Start wartet auf Server
|
// Solo Mode - Jetzt standardmäßig OFFLINE
|
||||||
g.roomID = fmt.Sprintf("solo_%d", time.Now().UnixNano())
|
|
||||||
g.isHost = true
|
g.isHost = true
|
||||||
g.appState = StateLobby // Warte auf Server Auto-Start
|
g.startOfflineGame()
|
||||||
log.Printf("🎮 Solo-Spiel gestartet: %s (warte auf Server)", playerName)
|
log.Printf("🎮 Solo-Spiel OFFLINE gestartet: %s", playerName)
|
||||||
|
return nil
|
||||||
} else if mode == "coop" && len(args) >= 5 {
|
} else if mode == "coop" && len(args) >= 5 {
|
||||||
// Co-op Mode - in die Lobby
|
// Co-op Mode - in die Lobby
|
||||||
roomID := args[2].String()
|
roomID := args[2].String()
|
||||||
|
|||||||
Reference in New Issue
Block a user