Fix 4: Remove Art2dUrl/ModelUrl from UnitDelta

These URLs are fixed for the lifetime of a card definition and are
already delivered once in the initial UnitSnapshot (CardInstanceDto).
Sending them again in every UnitDelta was wasting bandwidth on every
stat change, move, and attack.

Server:
- GameStateDiffer.DiffUnit: remove Art2dUrl/ModelUrl from the anyChange
  detection block and from the UnitDelta constructor call
- GameMessages.UnitDelta record: remove string? Art2dUrl and ModelUrl
  fields (CardInstanceDto/UnitSnapshot retains both — first placement
  delivery is unaffected)

Client:
- Game.gd _merge_unit_delta: remove the five URL merge lines
  (art2dUrl, Art2dUrl, modelUrl, ModelUrl, modelurl). Values on the
  unit dict are set once via unitsAdded and stay for the unit's lifetime.

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:
dingo
2026-05-20 20:34:30 -04:00
co-authored by Claude Happy
parent e7bf25759f
commit 93e3c8b0db
3 changed files with 8 additions and 13 deletions
+2 -5
View File
@@ -697,11 +697,8 @@ func _merge_unit_delta(unit: Dictionary, ud: Dictionary) -> void:
if ud.has("effectsJson") and ud["effectsJson"] != null: unit["effectsJson"] = ud["effectsJson"]
if ud.has("abilitiesJson") and ud["abilitiesJson"] != null: unit["abilitiesJson"] = ud["abilitiesJson"]
if ud.has("abilityUsesJson") and ud["abilityUsesJson"] != null: unit["abilityUsesJson"] = ud["abilityUsesJson"]
if ud.has("art2dUrl") and ud["art2dUrl"] != null: unit["art2dUrl"] = ud["art2dUrl"]
if ud.has("Art2dUrl") and ud["Art2dUrl"] != null: unit["Art2dUrl"] = ud["Art2dUrl"]
if ud.has("modelUrl") and ud["modelUrl"] != null: unit["modelUrl"] = ud["modelUrl"]
if ud.has("ModelUrl") and ud["ModelUrl"] != null: unit["ModelUrl"] = ud["ModelUrl"]
if ud.has("modelurl") and ud["modelurl"] != null: unit["modelurl"] = ud["modelurl"]
# art2dUrl and modelUrl are not merged from deltas — they are fixed per card definition
# and are set once when the unit is added via unitsAdded (UnitSnapshot).
func _on_server_push(type: String, payload: Variant) -> void: