diff options
author | Paul Gilbert | 2011-03-19 22:16:29 +1100 |
---|---|---|
committer | strangerke | 2011-03-21 08:07:17 +0100 |
commit | b1af59029864710ae66b0890d9208c6b674e0c26 (patch) | |
tree | 43264b8753f0369ab40203c2307d8d0acc4312a6 /engines/tsage/core.h | |
parent | dd29c4695f2127b37340197ba500736c1f53649c (diff) | |
download | scummvm-rg350-b1af59029864710ae66b0890d9208c6b674e0c26.tar.gz scummvm-rg350-b1af59029864710ae66b0890d9208c6b674e0c26.tar.bz2 scummvm-rg350-b1af59029864710ae66b0890d9208c6b674e0c26.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> { |