diff options
author | Paul Gilbert | 2011-03-19 22:16:29 +1100 |
---|---|---|
committer | Paul Gilbert | 2011-03-19 22:16:29 +1100 |
commit | 88b909b26df5a5d40e8d5792e3d6b502740c332f (patch) | |
tree | 45193bf9d81085a27fa07dbf4108c49b81adb63d /engines/tsage/core.h | |
parent | ec7e7519112247470e3e539a43040022a6e12c6e (diff) | |
download | scummvm-rg350-88b909b26df5a5d40e8d5792e3d6b502740c332f.tar.gz scummvm-rg350-88b909b26df5a5d40e8d5792e3d6b502740c332f.tar.bz2 scummvm-rg350-88b909b26df5a5d40e8d5792e3d6b502740c332f.zip |
TSAGE: Corrected bugs in Scene #1400 - Ringworld Wall
Diffstat (limited to 'engines/tsage/core.h')
-rw-r--r-- | engines/tsage/core.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/tsage/core.h b/engines/tsage/core.h index d961f8bdd1..d4c25b1668 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -652,8 +652,9 @@ private: void sortList(Common::Array<SceneObject *> &ObjList); List<SceneObject *> _objList; + bool _listAltered; public: - SceneObjectList() {} + SceneObjectList() { _listAltered = false; } virtual Common::String getClassName() { return "SceneObjectList"; } virtual void synchronise(Serialiser &s); @@ -665,7 +666,8 @@ public: typedef void (*EventHandlerFn)(EventHandler *fn); void recurse(EventHandlerFn Fn) { // Loop through each object - for (List<SceneObject *>::iterator i = _objList.begin(); i != _objList.end(); ) { + _listAltered = false; + for (List<SceneObject *>::iterator i = _objList.begin(); i != _objList.end() && !_listAltered; ) { SceneObject *o = *i; ++i; Fn(o); @@ -676,7 +678,10 @@ public: bool contains(SceneObject *sceneObj) { return _objList.contains(sceneObj); } void push_back(SceneObject *sceneObj) { _objList.push_back(sceneObj); } void push_front(SceneObject *sceneObj) { _objList.push_front(sceneObj); } - void remove(SceneObject *sceneObj) { _objList.remove(sceneObj); } + void remove(SceneObject *sceneObj) { + _objList.remove(sceneObj); + _listAltered = true; + } }; class ScenePriorities: public List<Region> { |