diff --git a/Client/origin-client/autoloads/Game.gd b/Client/origin-client/autoloads/Game.gd index 7e07a72..46b5f69 100644 --- a/Client/origin-client/autoloads/Game.gd +++ b/Client/origin-client/autoloads/Game.gd @@ -273,9 +273,10 @@ func get_unit_by_id(instance_id: String) -> Dictionary: for u: Dictionary in p.get("field", []): if u.get("instanceId", "") == instance_id: return u - var arch: Dictionary = p.get("archSpirit", {}) - if arch.get("instanceId", "") == instance_id: - return arch + var arch_val: Variant = p.get("archSpirit") + if arch_val is Dictionary and not (arch_val as Dictionary).is_empty(): + if (arch_val as Dictionary).get("instanceId", "") == instance_id: + return arch_val return {} @@ -630,7 +631,11 @@ func _apply_delta(delta: Dictionary) -> void: var arch_delta := arch_update.get("delta") as Dictionary if arch_delta.is_empty(): continue - var arch: Dictionary = player.get("archSpirit", {}) + var arch_val: Variant = player.get("archSpirit") + if arch_val == null or not (arch_val is Dictionary): + request_sync() + continue + var arch := arch_val as Dictionary if arch.is_empty(): # Missing baseline (likely first sight of this arch). Ask for full sync. request_sync()