WIP: removing tiles

This commit is contained in:
Chanumask
2023-10-16 11:06:51 +02:00
parent 3bf3246aeb
commit 3677b7b7dc
37 changed files with 255 additions and 247 deletions

View File

@ -14,7 +14,7 @@ class CleanUp(Action):
super().__init__(d.CLEAN_UP)
def do(self, entity, state) -> Union[None, ActionResult]:
if dirt := state[d.DIRT].by_pos(entity.pos):
if dirt := next((x for x in state.entities.pos_dict[entity.pos] if "dirt" in x.name.lower()), None):
new_dirt_amount = dirt.amount - state[d.DIRT].clean_amount
if new_dirt_amount <= 0: