[Scummvm-git-logs] scummvm master -> 38959ebc2650e79296774cdf51f32f06fa3d0903

neuromancer noreply at scummvm.org
Thu Dec 8 08:18:01 UTC 2022


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
8eea9064df FREESCAPE: disallow player to change areas when it happens too close to the corners
2859ab0f44 FREESCAPE: update the sensor list when the current area changes in driller
38959ebc26 FREESCAPE: workaround to make sure walls are enforced


Commit: 8eea9064dfe7e0883b55988299ce81efaa273c0a
    https://github.com/scummvm/scummvm/commit/8eea9064dfe7e0883b55988299ce81efaa273c0a
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-12-08T09:19:04+01:00

Commit Message:
FREESCAPE: disallow player to change areas when it happens too close to the corners

Changed paths:
    engines/freescape/games/driller.cpp


diff --git a/engines/freescape/games/driller.cpp b/engines/freescape/games/driller.cpp
index 521e6cdf381..dcb731c83be 100644
--- a/engines/freescape/games/driller.cpp
+++ b/engines/freescape/games/driller.cpp
@@ -68,6 +68,7 @@ DrillerEngine::DrillerEngine(OSystem *syst, const ADGameDescription *gd) : Frees
 }
 
 void DrillerEngine::gotoArea(uint16 areaID, int entranceID) {
+	int prevAreaID = _currentArea ? _currentArea->getAreaID(): -1;
 	debugC(1, kFreescapeDebugMove, "Jumping to area: %d, entrance: %d", areaID, entranceID);
 	if (!_gameStateBits.contains(areaID))
 		_gameStateBits[areaID] = 0;
@@ -80,6 +81,16 @@ void DrillerEngine::gotoArea(uint16 areaID, int entranceID) {
 		traverseEntrance(entranceID);
 	} else if (entranceID == 0) {
 		int newPos = -1;
+		// FIX: The next check will abort changing the current another
+		// area if the player is too close to the corners
+		if ((_position.z() < 100 && _position.x() > 3900) ||
+			(_position.z() > 3900 && _position.x() < 100) ||
+			(_position.z() < 100 && _position.x()  < 100) ||
+			(_position.z() > 3900 && _position.x() > 3900)) {
+				assert(prevAreaID > 0);
+				_currentArea = _areaMap[prevAreaID];
+				return;
+		}
 		if (_position.z() < 200 || _position.z() >= 3800) {
 			if (_position.z() < 200)
 				newPos = 4000;


Commit: 2859ab0f44d8344b6936c6e501e344a76d56141a
    https://github.com/scummvm/scummvm/commit/2859ab0f44d8344b6936c6e501e344a76d56141a
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-12-08T09:19:04+01:00

Commit Message:
FREESCAPE: update the sensor list when the current area changes in driller

Changed paths:
    engines/freescape/games/driller.cpp


diff --git a/engines/freescape/games/driller.cpp b/engines/freescape/games/driller.cpp
index dcb731c83be..9868fb68f89 100644
--- a/engines/freescape/games/driller.cpp
+++ b/engines/freescape/games/driller.cpp
@@ -106,6 +106,7 @@ void DrillerEngine::gotoArea(uint16 areaID, int entranceID) {
 		} else
 			error("Invalid movement across areas");
 		assert(newPos != -1);
+		_sensors = _currentArea->getSensors();
 	}
 	_lastPosition = _position;
 


Commit: 38959ebc2650e79296774cdf51f32f06fa3d0903
    https://github.com/scummvm/scummvm/commit/38959ebc2650e79296774cdf51f32f06fa3d0903
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-12-08T09:19:04+01:00

Commit Message:
FREESCAPE: workaround to make sure walls are enforced

Changed paths:
    engines/freescape/movement.cpp


diff --git a/engines/freescape/movement.cpp b/engines/freescape/movement.cpp
index 4348ca4b618..553243f6b36 100644
--- a/engines/freescape/movement.cpp
+++ b/engines/freescape/movement.cpp
@@ -327,10 +327,20 @@ bool FreescapeEngine::checkCollisions(bool executeCode) {
 	Common::sort(objs.begin(), objs.end(), compareObjectsSizes);
 	uint16 areaID = _currentArea->getAreaID();
 
+	bool largeObjectWasBlocking = false;
 	for (auto &obj : objs) {
 		GeometricObject *gobj = (GeometricObject *)obj;
 		debugC(1, kFreescapeDebugMove, "Collided with object id %d of size %f %f %f", gobj->getObjectID(), gobj->getSize().x(), gobj->getSize().y(), gobj->getSize().z());
+		// The following check stops the player from going through big solid objects such as walls
+		// FIXME: find a better workaround of this
+		if (gobj->getSize().length() > 3000) {
+			if (largeObjectWasBlocking)
+				break;
+			largeObjectWasBlocking = true;
+		}
+
 		executeObjectConditions(gobj, false, true);
+
 		if (areaID != _currentArea->getAreaID())
 			break;
 	}




More information about the Scummvm-git-logs mailing list