Fix: clear game state on game.over to prevent matchmaking re-entry bug
When game.over was received, Game.state was not cleared. If both players
re-queued and matched again, the new GameScreen saw non-empty state and
called _on_state_updated instead of send_ready(), leaving the new session
stuck in Initializing. Clearing state = {} before emitting game_over fixes this.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -279,6 +279,7 @@ func _on_server_push(type: String, payload: Variant) -> void:
|
||||
var wc : String = str(d.get("winCondition", ""))
|
||||
var wd : int = int(d.get("winnerRankDelta", 0))
|
||||
var ld : int = int(d.get("loserRankDelta", 0))
|
||||
state = {} # Clear stale state so a new GameScreen calls send_ready() on the next match
|
||||
game_over.emit(winner, wc, wd, ld)
|
||||
|
||||
"game.session_abandoned":
|
||||
|
||||
Reference in New Issue
Block a user