maintainer test grabs temp state

This commit is contained in:
Chanumask
2023-11-23 12:52:27 +01:00
parent 3a7b727ec6
commit 4c85cac50f
9 changed files with 82 additions and 28 deletions

View File

@@ -83,7 +83,8 @@ class Door(Entity):
def tick(self, state):
# Check if no entity is standing in the door
if len(state.entities.pos_dict[self.pos]) <= 2:
if not any(e for e in state.entities.by_pos(self.pos) if e.var_can_collide or e.var_is_blocking_pos):
# if len(state.entities.pos_dict[self.pos]) <= 2: #can collide can block
if self.is_open and self.time_to_close:
self._decrement_timer()
return Result(f"{d.DOOR}_tick", c.VALID, entity=self)

View File

@@ -18,6 +18,7 @@ class Doors(Collection):
def tick_doors(self, state):
results = list()
for door in self:
assert(isinstance(door, Door))
tick_result = door.tick(state)
if tick_result is not None:
results.append(tick_result)