From effa48d7c396bc4516a3188f0ffbd5835ede9a91 Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewski Date: Wed, 13 May 2020 19:47:53 +0200 Subject: [PATCH] Fixing item pickup action after completing the movement --- src/entities/Entity.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/entities/Entity.py b/src/entities/Entity.py index 239dd1a..0cf7471 100644 --- a/src/entities/Entity.py +++ b/src/entities/Entity.py @@ -156,9 +156,11 @@ class Entity(pygame.sprite.Sprite): if self.move(nextMove): self.movesList.remove(nextMove) if not self.movesList: - # if self.canPickup: - # self.pickUp() - # self.canPickup = False + # Attempt to interact with the target. + try: + self.movementTarget.on_interaction(self) + except AttributeError: + pass self.movementTarget = None def update(self):