From: Christian Heller Date: Wed, 16 Dec 2020 22:51:38 +0000 (+0100) Subject: On dropping crate next to player, also drop its content /there/. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/static/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/todo?a=commitdiff_plain;h=bf3698bd7e0837d8b9ead6126435a3b5f1896230;p=plomrogue2 On dropping crate next to player, also drop its content /there/. --- diff --git a/plomrogue/tasks.py b/plomrogue/tasks.py index 9594505..eb9d31a 100644 --- a/plomrogue/tasks.py +++ b/plomrogue/tasks.py @@ -179,6 +179,9 @@ class Task_DROP(Task): target_position = self._get_move_target() dropped = self.thing.uncarry() dropped.position = target_position + if dropped.type_ == 'Crate': + for item in dropped.content: + item.position = target_position targets = [t for t in self.thing.game.things if t.position == dropped.position and not t == dropped] for target in targets: