aboutsummaryrefslogtreecommitdiff
path: root/src/scalevalapokalypsi/Model/Action.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/scalevalapokalypsi/Model/Action.scala')
-rw-r--r--src/scalevalapokalypsi/Model/Action.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/scalevalapokalypsi/Model/Action.scala b/src/scalevalapokalypsi/Model/Action.scala
index a781ee8..fdfbf75 100644
--- a/src/scalevalapokalypsi/Model/Action.scala
+++ b/src/scalevalapokalypsi/Model/Action.scala
@@ -29,7 +29,10 @@ class Action(input: String):
val resOption: Option[(Boolean, Event)] = this.verb match
case "go" =>
val result = actor.go(this.modifiers)
- result.foreach(r => oldLocation.observeEvent(r))
+ result.foreach(r =>
+ if actor.location != oldLocation then
+ oldLocation.observeEvent(r)
+ )
result.map((true, _))
case "rest" => Some((true, actor.rest()))
case "get" => Some((false, actor.pickUp(this.modifiers)))