aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/engine/script.h1
-rw-r--r--engines/sci/engine/seg_manager.cpp4
2 files changed, 3 insertions, 2 deletions
diff --git a/engines/sci/engine/script.h b/engines/sci/engine/script.h
index 90a7c7a11e..1ebae3b7a8 100644
--- a/engines/sci/engine/script.h
+++ b/engines/sci/engine/script.h
@@ -88,6 +88,7 @@ public:
reg_t *getLocalsBegin() { return _localsBlock ? _localsBlock->_locals.begin() : NULL; }
void syncLocalsBlock(SegManager *segMan);
ObjMap &getObjectMap() { return _objects; }
+ const ObjMap &getObjectMap() const { return _objects; }
public:
Script();
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index 6722cda6c9..f7da0ce970 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -269,8 +269,8 @@ reg_t SegManager::findObjectByName(const Common::String &name, int index) {
if (mobj->getType() == SEG_TYPE_SCRIPT) {
// It's a script, scan all objects in it
- Script *scr = (Script *)mobj;
- ObjMap objects = scr->getObjectMap();
+ const Script *scr = (const Script *)mobj;
+ const ObjMap& objects = scr->getObjectMap();
for (ObjMap::const_iterator it = objects.begin(); it != objects.end(); ++it) {
objpos.offset = it->_value.getPos().offset;
if (name == getObjectName(objpos))