home
·
contact
·
privacy
projects
/
plomrogue2-experiments
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
85fa189
)
Add thing collision detection on movement.
author
Christian Heller
<c.heller@plomlompom.de>
Sun, 8 Nov 2020 01:16:16 +0000
(
02:16
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Sun, 8 Nov 2020 01:16:16 +0000
(
02:16
+0100)
new2/plomrogue/tasks.py
patch
|
blob
|
history
diff --git
a/new2/plomrogue/tasks.py
b/new2/plomrogue/tasks.py
index bb78b98699a84ac507699074de4d45dd37237fbd..99bb41f516249e81dc3470caa09444e18c21047d 100644
(file)
--- a/
new2/plomrogue/tasks.py
+++ b/
new2/plomrogue/tasks.py
@@
-36,6
+36,8
@@
class Task_MOVE(Task):
test_pos = self.get_move_target()
if test_pos is None:
raise PlayError('would move out of map')
+ elif test_pos in [t.position for t in self.thing.game.things]:
+ raise PlayError('would collide with other things')
elif self.thing.game.map[test_pos] != '.':
raise PlayError('would move into illegal territory')