fix(game): centralize death resolution, reorder UnitAttack trigger, clear Position on zone transitions
- FireTrigger(UnitAttack) now fires BEFORE ApplyDamage so triggered abilities can modify attacker/target stats before damage lands - AbilitySystem.KillUnit is now leader-aware: killing an ArchSpirit (in field or ArchSpirit slot) calls GameEngine.EliminatePlayer instead of silently failing - MoveToDiscard and RemoveFromAllZones both clear Position = null on zone transitions - RemoveFromAllZones guards against direct ArchSpirit removal (throws InvalidOperationException) - EliminatePlayer made internal for cross-class access from AbilitySystem - Client: improved JSON parsing error handling in Network.gd; debug_output enabled in Game.gd 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:
@@ -234,10 +234,22 @@ func _poll_packets() -> void:
|
||||
_last_rx_time = _now()
|
||||
_ping_sent_at = -1.0 # Any received packet resets the ping watchdog.
|
||||
|
||||
if raw.size() == 0 or text.strip_edges().is_empty():
|
||||
if debug_log_packets:
|
||||
print("[Net] << <empty packet>")
|
||||
continue
|
||||
|
||||
if debug_log_packets:
|
||||
print("[Net] << %s" % text)
|
||||
|
||||
var parsed: Variant = JSON.parse_string(text)
|
||||
var json := JSON.new()
|
||||
var err := json.parse(text)
|
||||
if err != OK:
|
||||
push_warning("Network: invalid JSON packet (%s) — %s"
|
||||
% [json.get_error_message(), text])
|
||||
continue
|
||||
|
||||
var parsed: Variant = json.data
|
||||
#print("[Parsed Type] ", type_string(typeof(parsed)))
|
||||
if typeof(parsed) != TYPE_DICTIONARY:
|
||||
if (parsed != null):
|
||||
|
||||
Reference in New Issue
Block a user