[Scummvm-git-logs] scummvm master -> 8cdc9334dd7edbc27d471e4ddba698f1a8221551
neuromancer
noreply at scummvm.org
Mon Nov 14 18:15:25 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
8cdc9334dd FREESCAPE: better checks for drill position in driller
Commit: 8cdc9334dd7edbc27d471e4ddba698f1a8221551
https://github.com/scummvm/scummvm/commit/8cdc9334dd7edbc27d471e4ddba698f1a8221551
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-11-14T19:11:58+01:00
Commit Message:
FREESCAPE: better checks for drill position in driller
Changed paths:
engines/freescape/games/driller.cpp
diff --git a/engines/freescape/games/driller.cpp b/engines/freescape/games/driller.cpp
index c599c1e134f..48a10412e95 100644
--- a/engines/freescape/games/driller.cpp
+++ b/engines/freescape/games/driller.cpp
@@ -550,10 +550,20 @@ bool DrillerEngine::checkDrill(const Math::Vector3d position) {
obj = (GeometricObject *)_areaMap[255]->objectWithID(id);
assert(obj);
obj = (GeometricObject *)obj->duplicate();
+ origin.setValue(1, origin.y() - 5);
obj->setOrigin(origin);
- //if (!_currentArea->checkCollisions(obj->_boundingBox))
- // return false;
+ // This bounding box is too large and can result in the drill to float next to a wall
+ if (_currentArea->checkCollisions(obj->_boundingBox).empty())
+ return false;
+
+ origin.setValue(1, origin.y() + 15);
+ obj->setOrigin(origin);
+
+ if (!_currentArea->checkCollisions(obj->_boundingBox).empty())
+ return false;
+
+ origin.setValue(1, origin.y() - 10);
heightLastObject = obj->getSize().y();
delete obj;
@@ -596,20 +606,6 @@ bool DrillerEngine::checkDrill(const Math::Vector3d position) {
heightLastObject = obj->getSize().y();
// origin.setValue(2, origin.z() - obj->getSize().z() / 5);
delete obj;
-
- id = 252;
- debugC(1, kFreescapeDebugParser, "Adding object %d to room structure", id);
- obj = (GeometricObject *)_areaMap[255]->objectWithID(id);
- assert(obj);
- obj = (GeometricObject *)obj->duplicate();
- origin.setValue(1, origin.y() + heightLastObject);
- obj->setOrigin(origin);
- assert(obj);
-
- if (!_currentArea->checkCollisions(obj->_boundingBox).empty())
- return false;
-
- delete obj;
return true;
}
More information about the Scummvm-git-logs
mailing list