aboutsummaryrefslogtreecommitdiff
path: root/engines/wage/wage.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2016-04-05 18:35:36 +0200
committerEugene Sandulenko2016-04-05 18:35:36 +0200
commit644b4dcd0b3a01751ed525370a9c6bc4ccc4bbc6 (patch)
tree5e7543546fe1b0f8c2cceaf6e5c1cdad438123ac /engines/wage/wage.cpp
parentdee6957c314be54df8b5c1e6ce0f8989f215e58c (diff)
downloadscummvm-rg350-644b4dcd0b3a01751ed525370a9c6bc4ccc4bbc6.tar.gz
scummvm-rg350-644b4dcd0b3a01751ed525370a9c6bc4ccc4bbc6.tar.bz2
scummvm-rg350-644b4dcd0b3a01751ed525370a9c6bc4ccc4bbc6.zip
WAGE: Fixed moving objects to random scene
Diffstat (limited to 'engines/wage/wage.cpp')
-rw-r--r--engines/wage/wage.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp
index e0299c8da2..a6f5bb7990 100644
--- a/engines/wage/wage.cpp
+++ b/engines/wage/wage.cpp
@@ -284,8 +284,9 @@ void WageEngine::performInitialSetup() {
if (!obj->_sceneOrOwner.equalsIgnoreCase(STORAGESCENE)) {
Common::String location = obj->_sceneOrOwner;
location.toLowercase();
- if (_world->_scenes.contains(location)) {
- _world->move(obj, _world->_scenes[location]);
+ Scene *scene = getSceneByName(location);
+ if (scene != NULL) {
+ _world->move(obj, scene);
} else {
if (!_world->_chrs.contains(location)) {
// Note: PLAYER@ is not a valid target here.
@@ -328,13 +329,14 @@ void WageEngine::doClose() {
}
Scene *WageEngine::getSceneByName(Common::String &location) {
- Scene *scene;
if (location.equals("random@")) {
- scene = _world->getRandomScene();
+ return _world->getRandomScene();
} else {
- scene = _world->_scenes[location];
+ if (_world->_scenes.contains(location))
+ return _world->_scenes[location];
+ else
+ return NULL;
}
- return scene;
}
void WageEngine::onMove(Designed *what, Designed *from, Designed *to) {