Fix SummonToken tile-filter validation: reject bad picks before costs are paid
Three bugs fixed for abilities like Demonate Leviathan (SummonToken + TileFilter):
1. Server: AbilityUsesThisTurn was incremented (and costs paid) before effect-level
TileFilter validation ran. Added PreValidateClientTileTargets() called before the
use-count increment so an invalid tile pick wastes no uses and no sacrificed tokens.
2. Server: SummonToken silently break'd when TileFilter or token-affinity check failed,
giving the client no error. Changed both to throw GameException("INVALID_TILE").
3. Client: tile_passes_filters() only checked the target selector's filters, not the
effect-level TileFilter (e.g. SummonToken.tileFilter). Added _collect_effect_tile_filters()
and TileAffinityMatches handling so invalid tiles are never highlighted or accepted.
Also includes: Art2dUrl/ModelUrl deltas in GameStateDiffer/GameMessages/GameEngine,
unit_mesh_builder token-model URL fallback + shader/tint helpers, ModelCache v3 bump,
Game.gd unit delta merging for art2dUrl/modelUrl.
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:
@@ -692,6 +692,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("modelUrl") and ud["modelUrl"] != null: unit["modelUrl"] = ud["modelUrl"]
|
||||
|
||||
|
||||
func _on_server_push(type: String, payload: Variant) -> void:
|
||||
|
||||
Reference in New Issue
Block a user