Fix: explicit Dictionary types on Variant-inferred locals (GDScript warning)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
dingo
2026-03-10 20:23:30 -04:00
co-authored by Claude Happy
parent 200c061dd3
commit ad06f69331
@@ -1357,12 +1357,12 @@ func _highlight_ability_targets(action: Dictionary) -> void:
func _unit_passes_filters(unit: Dictionary, filters: Array) -> bool:
if filters.is_empty(): return true
var src := Game.get_unit_by_id(_ability_unit_id)
var src_pos := src.get("position", {})
var src_pos : Dictionary = src.get("position", {})
for f: Dictionary in filters:
match f.get("$type", ""):
"withinrange":
if src_pos.is_empty(): return false
var tgt_pos := unit.get("position", {})
var tgt_pos : Dictionary = unit.get("position", {})
if tgt_pos.is_empty(): return false
var dist := (absi(int(tgt_pos.get("x", 0)) - int(src_pos.get("x", 0))) +
absi(int(tgt_pos.get("y", 0)) - int(src_pos.get("y", 0))))
@@ -1370,7 +1370,7 @@ func _unit_passes_filters(unit: Dictionary, filters: Array) -> bool:
return false
"isadjacenttosource":
if src_pos.is_empty(): return false
var tgt_pos := unit.get("position", {})
var tgt_pos : Dictionary = unit.get("position", {})
if tgt_pos.is_empty(): return false
var dist := (absi(int(tgt_pos.get("x", 0)) - int(src_pos.get("x", 0))) +
absi(int(tgt_pos.get("y", 0)) - int(src_pos.get("y", 0))))
@@ -1382,7 +1382,7 @@ func _unit_passes_filters(unit: Dictionary, filters: Array) -> bool:
func _tile_passes_filters(tx: int, ty: int, filters: Array) -> bool:
if filters.is_empty(): return true
var src := Game.get_unit_by_id(_ability_unit_id)
var src_pos := src.get("position", {})
var src_pos : Dictionary = src.get("position", {})
for f: Dictionary in filters:
match f.get("$type", ""):
"tilewithinrange":