aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/scripts.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2018-05-27 14:45:01 -0400
committerPaul Gilbert2018-05-27 14:45:01 -0400
commit057bf6ea921bea28c3b09a4905c81af65f03c7eb (patch)
tree334a0921041f99ec0a5d9f111737f3691ea07c78 /engines/xeen/scripts.cpp
parent9abcaecb0c2c4d58b85856f06152dec838ebda96 (diff)
downloadscummvm-rg350-057bf6ea921bea28c3b09a4905c81af65f03c7eb.tar.gz
scummvm-rg350-057bf6ea921bea28c3b09a4905c81af65f03c7eb.tar.bz2
scummvm-rg350-057bf6ea921bea28c3b09a4905c81af65f03c7eb.zip
XEEN: Leave chests open after their contents are taken
Diffstat (limited to 'engines/xeen/scripts.cpp')
-rw-r--r--engines/xeen/scripts.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp
index 66e9013cda..bc0b179d4c 100644
--- a/engines/xeen/scripts.cpp
+++ b/engines/xeen/scripts.cpp
@@ -216,20 +216,23 @@ int Scripts::checkEvents() {
MazeObject &selectedObj = map._mobData._objects[intf._objNumber];
if (selectedObj._spriteId == (ccNum ? 15 : 16)) {
- for (int idx = 0; idx < MIN((int)map._mobData._objects.size(), 16); ++idx) {
- MazeObject &obj = map._mobData._objects[idx];
- if (obj._spriteId == (ccNum ? 62 : 57)) {
+ // Treasure chests that were opened will be set to be in an open, empty state
+ for (uint idx = 0; idx < map._mobData._objectSprites.size(); ++idx) {
+ MonsterObjectData::SpriteResourceEntry &e = map._mobData._objectSprites[idx];
+ if (e._spriteId == (ccNum ? 57 : 62)) {
selectedObj._id = idx;
- selectedObj._spriteId = ccNum ? 62 : 57;
+ selectedObj._spriteId = ccNum ? 57 : 62;
+ selectedObj._sprites = &e._sprites;
break;
}
}
} else if (selectedObj._spriteId == 73) {
- for (int idx = 0; idx < MIN((int)map._mobData._objects.size(), 16); ++idx) {
- MazeObject &obj = map._mobData._objects[idx];
- if (obj._spriteId == 119) {
+ for (uint idx = 0; idx < map._mobData._objectSprites.size(); ++idx) {
+ MonsterObjectData::SpriteResourceEntry &e = map._mobData._objectSprites[idx];
+ if (e._spriteId == 119) {
selectedObj._id = idx;
selectedObj._spriteId = 119;
+ selectedObj._sprites = &e._sprites;
break;
}
}