fix: preserve mutable floor entities compatibility

This commit is contained in:
goose
2026-10-02 18:27:56 -04:00
parent 1ed6c677a3
commit aac1e451b6
3 changed files with 34 additions and 10 deletions
+3 -8
View File
@@ -9,16 +9,11 @@ var entrance := Vector2i.ZERO
var exit := Vector2i.ZERO
var enemies: Dictionary[StringName, ActorState] = {}
var npcs: Dictionary[StringName, ActorState] = {}
# Legacy callers use the generic actor view. New floor code owns the explicit
# collections above; this compatibility view is derived from both of them.
# Legacy callers mutate the generic actor dictionary directly. It must remain
# the real enemy store rather than an aggregate snapshot; NPCs stay explicit.
var entities: Dictionary[StringName, ActorState]:
get:
var all_entities: Dictionary[StringName, ActorState] = {}
for actor_id in enemies:
all_entities[actor_id] = enemies[actor_id]
for actor_id in npcs:
all_entities[actor_id] = npcs[actor_id]
return all_entities
return enemies
set(value):
enemies = value
npcs.clear()