aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/set.cpp
diff options
context:
space:
mode:
authorThanasis Antoniou2019-05-04 17:24:20 +0300
committerThanasis Antoniou2019-05-04 17:25:34 +0300
commitd666eb154a027b34302a34d090abbda2cf69ce58 (patch)
tree0db83225c2be71eed8bead048aa81e20367f0b9f /engines/bladerunner/set.cpp
parent7d2777e1d7f1abef54272ffb4287e26738a8a554 (diff)
downloadscummvm-rg350-d666eb154a027b34302a34d090abbda2cf69ce58.tar.gz
scummvm-rg350-d666eb154a027b34302a34d090abbda2cf69ce58.tar.bz2
scummvm-rg350-d666eb154a027b34302a34d090abbda2cf69ce58.zip
BLADERUNNER: Fix rats re-spawn and UG09, UG13 bad paths
UG09 bad path allowed McCoy to teleport to the pipe top left. UG13, when elevator was up McCoy could walk in the empty chute
Diffstat (limited to 'engines/bladerunner/set.cpp')
-rw-r--r--engines/bladerunner/set.cpp53
1 files changed, 50 insertions, 3 deletions
diff --git a/engines/bladerunner/set.cpp b/engines/bladerunner/set.cpp
index 1e441f68db..6d898bdc80 100644
--- a/engines/bladerunner/set.cpp
+++ b/engines/bladerunner/set.cpp
@@ -90,6 +90,7 @@ bool Set::open(const Common::String &name) {
_objects[i].isTarget = 0;
s->skip(4);
}
+ patchInAdditionalObjectsInSet();
_walkboxCount = s->readUint32LE();
assert(_walkboxCount <= 95);
@@ -424,12 +425,58 @@ void Set::load(SaveFileReadStream &f) {
* TODO If we have many such cases, perhaps we could use a lookup table
* using sceneId, objectId (or name) as keys
*/
-void Set::overrideSceneObjectInfo(int objectId) const { // For bugfixes with respect to clickable/targetable box positioning/bounding box
- if (_vm->_scene->getSceneId() == kSceneBB06) { /// Sebastian's room with doll
- if (_objects[objectId].name == "BOX31") { // dollhouse box in BB06
+void Set::overrideSceneObjectInfo(int objectId) const {
+ switch (_vm->_scene->getSceneId()) {
+ case kSceneBB06:
+ // Sebastian's room with doll
+ if (objectId == 3 && _objects[objectId].name == "BOX31") {
+ // dollhouse box in BB06
_objects[objectId].bbox.setXYZ(-161.47f, 30.0f, 53.75f, -110.53f, 69.81f, 90.90f);
}
+ break;
+ case kSceneUG09:
+ // block passage to buggy pipe
+ if (objectId == 7 && _objects[objectId].name == "BOXS FOR ARCHWAY 01") {
+ _objects[objectId].bbox.setXYZ(-168.99f, 151.38f, -139.10f, -105.95f, 239.59f, 362.70);
+ }
+ break;
+ default:
+ return;
}
}
+/**
+* Used for adding objects in a Set mainly to fix a few "McCoy walking to places he should not" issues
+* This is called in Set::open()
+* Note:
+* - ScummVM (post fix) save games will have the extra objects information
+* - Original save games will not have the extra objects if the save game room scene was an affected scene
+* but they will get them if the player exits and re-enters. The code anticipates not finding an object in a scene
+* so this should not be an issue.
+*/
+void Set::patchInAdditionalObjectsInSet() {
+ Common::String custObjName;
+ int objectId = _objectCount;
+ BoundingBox bbox;
+ switch (_vm->_scene->getSceneId()) {
+ case kSceneUG13:
+ // Underground homeless place
+ // block passage to empty elevator chute
+ bbox = BoundingBox(-80.00f, 35.78f, -951.75f, 74.36f, 364.36f, -810.56f);
+ custObjName = "ELEVBLOCK";
+ break;
+ default:
+ return;
+ }
+
+ _objectCount++;
+ _objects[objectId].name = custObjName.c_str();
+ _objects[objectId].bbox = bbox;
+ _objects[objectId].isObstacle = 0; // init as false - Can be changed in Scene script eg. SceneLoaded() with (Un)Obstacle_Object()
+ _objects[objectId].isClickable = 0; // init as false - Can be changed in Scene script eg. SceneLoaded() with (Un)Clickable_Object()
+ _objects[objectId].isHotMouse = 0;
+ _objects[objectId].unknown1 = 0;
+ _objects[objectId].isTarget = 0; // init as false - Can be changed in Scene script eg. SceneLoaded() with (Un_)Combat_Target_Object
+}
+
} // End of namespace BladeRunner