From 59b2809f3740923cc63477a25eaabde2535f6f2e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 25 Dec 2015 12:02:28 +0100 Subject: [PATCH] WAGE: Finished WageEngine::performInitialSetup() --- engines/wage/wage.cpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp index 173646b5bc04..615a7a0b754b 100644 --- a/engines/wage/wage.cpp +++ b/engines/wage/wage.cpp @@ -166,28 +166,25 @@ void WageEngine::performInitialSetup() { for (int i = 0; i < _world->_orderedChrs.size(); i++) _world->move(_world->_orderedChrs[i], &_world->_storageScene); - warning("STUB: performInitialSetup"); -/* - for (int i = 0; i < _world->_orderedObjs.size(); i++) - Obj obj = _world->_orderedObjs[i]; - if (!obj.getSceneOrOwner().equalsIgnoreCase(World.STORAGE)) { - String location = obj.getSceneOrOwner().toLowerCase(); - Scene scene = getSceneByName(location); - if (scene != null) { - world.move(obj, scene); + for (int i = 0; i < _world->_orderedObjs.size(); i++) { + Obj *obj = _world->_orderedObjs[i]; + if (!obj->_sceneOrOwner.equalsIgnoreCase(STORAGESCENE)) { + String location = obj->_sceneOrOwner; + location.toLowercase(); + if (_world->_scenes.contains(location)) { + _world->move(obj, _world->_scenes[location]); } else { - Chr chr = world.getChrs().get(location); - if (chr == null) { + if (!_world->_chrs.contains(location)) { // Note: PLAYER@ is not a valid target here. - System.err.printf("Couldn't move %s to %s\n", obj.getName(), obj.getSceneOrOwner()); + warning("Couldn't move %s to %s", obj->_name.c_str(), obj->_sceneOrOwner.c_str()); } else { // TODO: Add check for max items. - world.move(obj, chr); + _world->move(obj, _world->_chrs[location]); } } } } -*/ + bool playerPlaced = false; for (int i = 0; i < _world->_orderedChrs.size(); i++) { Chr *chr = _world->_orderedChrs[i];