fix: preserve mutable floor entities compatibility
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user