diff options
author | Vladimir Menshakov | 2009-11-14 11:29:37 +0000 |
---|---|---|
committer | Vladimir Menshakov | 2009-11-14 11:29:37 +0000 |
commit | a6f954c365cc186bfd8770d088ffc3333c9224a8 (patch) | |
tree | 8e1aff9d3c41ed35ac8f9aaecee23d5003179ccd | |
parent | bed40c5a1331f88a6dc9cfe03ad59c16bfb2da91 (diff) | |
download | scummvm-rg350-a6f954c365cc186bfd8770d088ffc3333c9224a8.tar.gz scummvm-rg350-a6f954c365cc186bfd8770d088ffc3333c9224a8.tar.bz2 scummvm-rg350-a6f954c365cc186bfd8770d088ffc3333c9224a8.zip |
added cancel() for current action
svn-id: r45890
-rw-r--r-- | engines/teenagent/teenagent.cpp | 8 | ||||
-rw-r--r-- | engines/teenagent/teenagent.h | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp index 51f736d397..f6de12b554 100644 --- a/engines/teenagent/teenagent.cpp +++ b/engines/teenagent/teenagent.cpp @@ -121,11 +121,11 @@ void TeenAgentEngine::use(Object *object) { object->rect.dump(); object->actor_rect.dump(); + action = kActionUse; if (object->actor_rect.valid()) scene->moveTo(Common::Point(object->actor_rect.right, object->actor_rect.bottom), object->actor_orientation); - if (object->actor_orientation > 0) + else if (object->actor_orientation > 0) scene->setOrientation(object->actor_orientation); - action = kActionUse; } void TeenAgentEngine::examine(const Common::Point &point, Object *object) { @@ -135,15 +135,15 @@ void TeenAgentEngine::examine(const Common::Point &point, Object *object) { if (object != NULL) { Common::Point dst = object->actor_rect.center(); debug(0, "click %d, %d, object %d, %d", point.x, point.y, dst.x, dst.y); + action = kActionExamine; if (object->actor_rect.valid()) scene->moveTo(dst, object->actor_orientation); - action = kActionExamine; dst_object = object; } else { debug(0, "click %d, %d", point.x, point.y); + action = kActionNone; scene->moveTo(point, 0, true); dst_object = NULL; - action = kActionNone; } } diff --git a/engines/teenagent/teenagent.h b/engines/teenagent/teenagent.h index 7da0eb5f35..232762bf15 100644 --- a/engines/teenagent/teenagent.h +++ b/engines/teenagent/teenagent.h @@ -59,6 +59,7 @@ public: void examine(const Common::Point &point, Object *object); void use(Object *object); + inline void cancel() { action = kActionNone; } bool processCallback(uint16 addr); inline Scene *getScene() { return scene; } |