[Scummvm-git-logs] scummvm master -> 9f9bf386f8b0eae720da53ab9d54532b8e535e60

mgerhardy martin.gerhardy at gmail.com
Sun Aug 15 18:02:26 UTC 2021


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

Summary:
bb143af989 TWINE: removed projectPositionOnScreen call
c181616ee7 TWINE: allow to quit the game while the behaviour menu is active
af52b8089e TWINE: fixed moving actor bbox rendering
cbea2c3e75 TWINE: reduced code duplication
7c068a774d TWINE: reduced code duplication
bf6672df34 TWINE: minor cleanup
9f9bf386f8 TWINE: fixed #12804 - scene 35 is solvable now


Commit: bb143af9891440128e210ac704d4b2f31f60a493
    https://github.com/scummvm/scummvm/commit/bb143af9891440128e210ac704d4b2f31f60a493
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-08-15T20:00:49+02:00

Commit Message:
TWINE: removed projectPositionOnScreen call

according to the disassembly these calls are correct and the second call just overrides the first
_cropBottomScreen value

also fixed the setting of the staticflags while the actor is dying

Changed paths:
    engines/twine/twine.cpp


diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index 2843265212..db31aaf82f 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -910,17 +910,16 @@ int32 TwinEEngine::runGameEngine() { // mainLoopInteration
 			if ((brickSound & 0xF0U) == 0xF0U) {
 				if ((brickSound & 0x0FU) == 1) {
 					if (IS_HERO(a)) {
+						// we are dying if we aren't using the protopack to fly over water
 						if (_actor->_heroBehaviour != HeroBehaviourType::kProtoPack || actor->_anim != AnimationTypes::kForward) {
 							if (!_actor->_cropBottomScreen) {
 								_animations->initAnim(AnimationTypes::kDrawn, AnimType::kAnimationType_4, AnimationTypes::kStanding, 0);
-								_renderer->projectPositionOnScreen(actor->pos() - _grid->_camera);
-								_actor->_cropBottomScreen = _renderer->_projPos.y;
 							}
-							_renderer->projectPositionOnScreen(actor->pos() - _grid->_camera);
+							const IVec3 &projPos = _renderer->projectPositionOnScreen(actor->pos() - _grid->_camera);
 							actor->_controlMode = ControlMode::kNoMove;
 							actor->setLife(-1);
-							_actor->_cropBottomScreen = _renderer->_projPos.y;
-							actor->_staticFlags.bCanDrown |= 0x10; // TODO: doesn't make sense
+							_actor->_cropBottomScreen = projPos.y;
+							actor->_staticFlags.bDoesntCastShadow = 1;
 						}
 					} else {
 						_sound->playSample(Samples::Explode, 1, actor->pos(), a);


Commit: c181616ee7672b71ccb875027633cf46fc6c6f1d
    https://github.com/scummvm/scummvm/commit/c181616ee7672b71ccb875027633cf46fc6c6f1d
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-08-15T20:00:49+02:00

Commit Message:
TWINE: allow to quit the game while the behaviour menu is active

Changed paths:
    engines/twine/menu/menu.cpp


diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index fa4c40d853..795489ba06 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -1057,6 +1057,9 @@ void Menu::processBehaviourMenu() {
 	while (_engine->_input->isActionActive(TwinEActionType::BehaviourMenu) || _engine->_input->isQuickBehaviourActionActive()) {
 		FrameMarker frame(_engine, 50);
 		_engine->readKeys();
+		if (_engine->shouldQuit()) {
+			break;
+		}
 
 #if 0
 		if (isBehaviourHovered(HeroBehaviourType::kNormal)) {


Commit: af52b8089ea2f8cb08e313db94ec6c1c7715556a
    https://github.com/scummvm/scummvm/commit/af52b8089ea2f8cb08e313db94ec6c1c7715556a
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-08-15T20:00:49+02:00

Commit Message:
TWINE: fixed moving actor bbox rendering

Changed paths:
    engines/twine/debugger/debug_scene.cpp


diff --git a/engines/twine/debugger/debug_scene.cpp b/engines/twine/debugger/debug_scene.cpp
index 5cfb04e349..b9bb6645cd 100644
--- a/engines/twine/debugger/debug_scene.cpp
+++ b/engines/twine/debugger/debug_scene.cpp
@@ -145,10 +145,6 @@ bool DebugScene::displayActors() {
 	bool state = false;
 	for (int32 a = 0; a < _engine->_scene->_sceneNumActors; a++) {
 		const ActorStruct *actorPtr = _engine->_scene->getActor(a);
-		// TODO: redrawing doesn't work properly yet for moving actors
-		if (!actorPtr->_staticFlags.bIsSpriteActor) {
-			continue;
-		}
 		const IVec3 &pos = actorPtr->pos();
 		const BoundingBox &bbox = actorPtr->_boudingBox;
 		const ScenePositionsProjected &positions = calculateBoxPositions(pos + bbox.mins, pos + bbox.maxs);
@@ -161,8 +157,15 @@ bool DebugScene::displayActors() {
 		const Common::Rect filledRect(positions.frontTopRightPoint2D.x, positions.frontTopRightPoint2D.y, positions.frontTopRightPoint2D.x + boxwidth, positions.frontTopRightPoint2D.y + boxheight);
 		_engine->_interface->drawFilledRect(filledRect, COLOR_WHITE);
 		_engine->_menu->drawRectBorders(filledRect);
-		_engine->drawText(positions.frontTopRightPoint2D.x, positions.frontTopRightPoint2D.y, Common::String::format("Actor: %i", a), true, false, boxwidth);
-		_engine->drawText(positions.frontTopRightPoint2D.x, positions.frontTopRightPoint2D.y + lineHeight, Common::String::format("pos: %i:%i:%i", positions.frontTopRightPoint.x, positions.frontTopRightPoint.y, positions.frontTopRightPoint.z), true, false, boxwidth);
+		_engine->drawText(positions.frontTopRightPoint2D.x, positions.frontTopRightPoint2D.y, Common::String::format("Actor: %i", a), true, true, boxwidth);
+		_engine->drawText(positions.frontTopRightPoint2D.x, positions.frontTopRightPoint2D.y + lineHeight, Common::String::format("pos: %i:%i:%i", pos.x, pos.y, pos.z), true, true, boxwidth);
+		const int16 rleft = positions.frontTopLeftPoint2D.x;
+		const int16 rtop = positions.backTopLeftPoint2D.y;
+		const int16 rright = positions.backTopRightPoint2D.x;
+		const int16 rbottom = positions.frontBottomRightPoint2D.y;
+		Common::Rect actorRect(rleft, rtop, rright, rbottom);
+		actorRect.extend(filledRect);
+		_engine->_redraw->addRedrawArea(actorRect);
 		state = true;
 	}
 	return state;


Commit: cbea2c3e754cc7563d36020d3e6e81c664398871
    https://github.com/scummvm/scummvm/commit/cbea2c3e754cc7563d36020d3e6e81c664398871
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-08-15T20:00:49+02:00

Commit Message:
TWINE: reduced code duplication

Changed paths:
    engines/twine/scene/collision.cpp


diff --git a/engines/twine/scene/collision.cpp b/engines/twine/scene/collision.cpp
index 24c00276ad..4265407615 100644
--- a/engines/twine/scene/collision.cpp
+++ b/engines/twine/scene/collision.cpp
@@ -214,56 +214,51 @@ int32 Collision::checkCollisionWithActors(int32 actorIdx) {
 				actor->_collision = a; // mark as collision with actor a
 
 				if (actorTest->_staticFlags.bIsCarrierActor) {
-					if (actor->_dynamicFlags.bIsFalling) {
+					if (actor->_dynamicFlags.bIsFalling || standingOnActor(actorIdx, a)) {
 						processActor.y = maxsTest.y - actor->_boudingBox.mins.y + 1;
 						actor->_standOn = a;
 					} else {
-						if (standingOnActor(actorIdx, a)) {
-							processActor.y = maxsTest.y - actor->_boudingBox.mins.y + 1;
-							actor->_standOn = a;
-						} else {
-							const int32 newAngle = _engine->_movements->getAngleAndSetTargetActorDistance(processActor, actorTest->pos());
-
-							if (actorTest->_staticFlags.bCanBePushed && !actor->_staticFlags.bCanBePushed) {
-								actorTest->_lastPos.y = 0;
-
-								if (actorTest->_staticFlags.bUseMiniZv) {
-									if (newAngle >= ANGLE_45 && newAngle < ANGLE_135 && actor->_angle > ANGLE_45 && actor->_angle < ANGLE_135) {
-										actorTest->_lastPos.x = 192;
-									}
-									if (newAngle >= ANGLE_135 && newAngle < ANGLE_225 && actor->_angle > ANGLE_135 && actor->_angle < ANGLE_225) {
-										actorTest->_lastPos.z = -64;
-									}
-									if (newAngle >= ANGLE_225 && newAngle < ANGLE_315 && actor->_angle > ANGLE_225 && actor->_angle < ANGLE_315) {
-										actorTest->_lastPos.x = -64;
-									}
-									if ((newAngle >= ANGLE_315 || newAngle < ANGLE_45) && (actor->_angle > ANGLE_315 || actor->_angle < ANGLE_45)) {
-										actorTest->_lastPos.x = 192;
-									}
-								} else {
-									actorTest->_lastPos.x = processActor.x - actor->_collisionPos.x;
-									actorTest->_lastPos.z = processActor.z - actor->_collisionPos.z;
-								}
-							}
+						const int32 newAngle = _engine->_movements->getAngleAndSetTargetActorDistance(processActor, actorTest->pos());
+
+						if (actorTest->_staticFlags.bCanBePushed && !actor->_staticFlags.bCanBePushed) {
+							actorTest->_lastPos.y = 0;
 
-							if ((actorTest->_boudingBox.maxs.x - actorTest->_boudingBox.mins.x == actorTest->_boudingBox.maxs.z - actorTest->_boudingBox.mins.z) &&
-								(actor->_boudingBox.maxs.x - actor->_boudingBox.mins.x == actor->_boudingBox.maxs.z - actor->_boudingBox.mins.z)) {
-								if (newAngle < ANGLE_135) {
-									processActor.x = minsTest.x - actor->_boudingBox.maxs.x;
+							if (actorTest->_staticFlags.bUseMiniZv) {
+								if (newAngle >= ANGLE_45 && newAngle < ANGLE_135 && actor->_angle > ANGLE_45 && actor->_angle < ANGLE_135) {
+									actorTest->_lastPos.x = 192;
 								}
-								if (newAngle >= ANGLE_135 && newAngle < ANGLE_225) {
-									processActor.z = maxsTest.z - actor->_boudingBox.mins.z;
+								if (newAngle >= ANGLE_135 && newAngle < ANGLE_225 && actor->_angle > ANGLE_135 && actor->_angle < ANGLE_225) {
+									actorTest->_lastPos.z = -64;
 								}
-								if (newAngle >= ANGLE_225 && newAngle < ANGLE_315) {
-									processActor.x = maxsTest.x - actor->_boudingBox.mins.x;
+								if (newAngle >= ANGLE_225 && newAngle < ANGLE_315 && actor->_angle > ANGLE_225 && actor->_angle < ANGLE_315) {
+									actorTest->_lastPos.x = -64;
 								}
-								if (newAngle >= ANGLE_315 || (newAngle < ANGLE_315 && newAngle < ANGLE_45)) {
-									processActor.z = minsTest.z - actor->_boudingBox.maxs.z;
+								if ((newAngle >= ANGLE_315 || newAngle < ANGLE_45) && (actor->_angle > ANGLE_315 || actor->_angle < ANGLE_45)) {
+									actorTest->_lastPos.x = 192;
 								}
 							} else {
-								if (!actor->_dynamicFlags.bIsFalling) {
-									processActor = previousActor;
-								}
+								actorTest->_lastPos.x = processActor.x - actor->_collisionPos.x;
+								actorTest->_lastPos.z = processActor.z - actor->_collisionPos.z;
+							}
+						}
+
+						if ((actorTest->_boudingBox.maxs.x - actorTest->_boudingBox.mins.x == actorTest->_boudingBox.maxs.z - actorTest->_boudingBox.mins.z) &&
+							(actor->_boudingBox.maxs.x - actor->_boudingBox.mins.x == actor->_boudingBox.maxs.z - actor->_boudingBox.mins.z)) {
+							if (newAngle < ANGLE_135) {
+								processActor.x = minsTest.x - actor->_boudingBox.maxs.x;
+							}
+							if (newAngle >= ANGLE_135 && newAngle < ANGLE_225) {
+								processActor.z = maxsTest.z - actor->_boudingBox.mins.z;
+							}
+							if (newAngle >= ANGLE_225 && newAngle < ANGLE_315) {
+								processActor.x = maxsTest.x - actor->_boudingBox.mins.x;
+							}
+							if (newAngle >= ANGLE_315 || (newAngle < ANGLE_315 && newAngle < ANGLE_45)) {
+								processActor.z = minsTest.z - actor->_boudingBox.maxs.z;
+							}
+						} else {
+							if (!actor->_dynamicFlags.bIsFalling) {
+								processActor = previousActor;
 							}
 						}
 					}


Commit: 7c068a774d5d0e23939d54a346ac88038c6538d9
    https://github.com/scummvm/scummvm/commit/7c068a774d5d0e23939d54a346ac88038c6538d9
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-08-15T20:00:49+02:00

Commit Message:
TWINE: reduced code duplication

the bug #12804 is affected by sprite and 3d actors - thus merging these code parts
should help with fixing it

Changed paths:
    engines/twine/scene/collision.cpp
    engines/twine/scene/collision.h


diff --git a/engines/twine/scene/collision.cpp b/engines/twine/scene/collision.cpp
index 4265407615..644c5ea15a 100644
--- a/engines/twine/scene/collision.cpp
+++ b/engines/twine/scene/collision.cpp
@@ -192,11 +192,59 @@ void Collision::reajustActorPosition(ShapeType brickShape) {
 	}
 }
 
+void Collision::handlePushing(const IVec3 &minsTest, const IVec3 &maxsTest, ActorStruct *actor, ActorStruct *actorTest) {
+	IVec3 &processActor = _engine->_movements->_processActor;
+	IVec3 &previousActor = _engine->_movements->_previousActor;
+
+	const int32 newAngle = _engine->_movements->getAngleAndSetTargetActorDistance(processActor, actorTest->pos());
+
+	if (actorTest->_staticFlags.bCanBePushed && !actor->_staticFlags.bCanBePushed) {
+		actorTest->_lastPos.y = 0;
+
+		if (actorTest->_staticFlags.bUseMiniZv) {
+			if (newAngle >= ANGLE_45 && newAngle < ANGLE_135 && actor->_angle > ANGLE_45 && actor->_angle < ANGLE_135) {
+				actorTest->_lastPos.x = 192;
+			}
+			if (newAngle >= ANGLE_135 && newAngle < ANGLE_225 && actor->_angle > ANGLE_135 && actor->_angle < ANGLE_225) {
+				actorTest->_lastPos.z = -64;
+			}
+			if (newAngle >= ANGLE_225 && newAngle < ANGLE_315 && actor->_angle > ANGLE_225 && actor->_angle < ANGLE_315) {
+				actorTest->_lastPos.x = -64;
+			}
+			if ((newAngle >= ANGLE_315 || newAngle < ANGLE_45) && (actor->_angle > ANGLE_315 || actor->_angle < ANGLE_45)) {
+				actorTest->_lastPos.x = 192;
+			}
+		} else {
+			actorTest->_lastPos.x = processActor.x - actor->_collisionPos.x;
+			actorTest->_lastPos.z = processActor.z - actor->_collisionPos.z;
+		}
+	}
+
+	if ((actorTest->_boudingBox.maxs.x - actorTest->_boudingBox.mins.x == actorTest->_boudingBox.maxs.z - actorTest->_boudingBox.mins.z) &&
+		(actor->_boudingBox.maxs.x - actor->_boudingBox.mins.x == actor->_boudingBox.maxs.z - actor->_boudingBox.mins.z)) {
+		if (newAngle < ANGLE_135) {
+			processActor.x = minsTest.x - actor->_boudingBox.maxs.x;
+		}
+		if (newAngle >= ANGLE_135 && newAngle < ANGLE_225) {
+			processActor.z = maxsTest.z - actor->_boudingBox.mins.z;
+		}
+		if (newAngle >= ANGLE_225 && newAngle < ANGLE_315) {
+			processActor.x = maxsTest.x - actor->_boudingBox.mins.x;
+		}
+		if (newAngle >= ANGLE_315 || (newAngle < ANGLE_315 && newAngle < ANGLE_45)) {
+			processActor.z = minsTest.z - actor->_boudingBox.maxs.z;
+		}
+	} else {
+		if (!actor->_dynamicFlags.bIsFalling) {
+			processActor = previousActor;
+		}
+	}
+}
+
 int32 Collision::checkCollisionWithActors(int32 actorIdx) {
 	ActorStruct *actor = _engine->_scene->getActor(actorIdx);
 
 	IVec3 &processActor = _engine->_movements->_processActor;
-	IVec3 &previousActor = _engine->_movements->_previousActor;
 	IVec3 mins = processActor + actor->_boudingBox.mins;
 	IVec3 maxs = processActor + actor->_boudingBox.maxs;
 
@@ -218,98 +266,13 @@ int32 Collision::checkCollisionWithActors(int32 actorIdx) {
 						processActor.y = maxsTest.y - actor->_boudingBox.mins.y + 1;
 						actor->_standOn = a;
 					} else {
-						const int32 newAngle = _engine->_movements->getAngleAndSetTargetActorDistance(processActor, actorTest->pos());
-
-						if (actorTest->_staticFlags.bCanBePushed && !actor->_staticFlags.bCanBePushed) {
-							actorTest->_lastPos.y = 0;
-
-							if (actorTest->_staticFlags.bUseMiniZv) {
-								if (newAngle >= ANGLE_45 && newAngle < ANGLE_135 && actor->_angle > ANGLE_45 && actor->_angle < ANGLE_135) {
-									actorTest->_lastPos.x = 192;
-								}
-								if (newAngle >= ANGLE_135 && newAngle < ANGLE_225 && actor->_angle > ANGLE_135 && actor->_angle < ANGLE_225) {
-									actorTest->_lastPos.z = -64;
-								}
-								if (newAngle >= ANGLE_225 && newAngle < ANGLE_315 && actor->_angle > ANGLE_225 && actor->_angle < ANGLE_315) {
-									actorTest->_lastPos.x = -64;
-								}
-								if ((newAngle >= ANGLE_315 || newAngle < ANGLE_45) && (actor->_angle > ANGLE_315 || actor->_angle < ANGLE_45)) {
-									actorTest->_lastPos.x = 192;
-								}
-							} else {
-								actorTest->_lastPos.x = processActor.x - actor->_collisionPos.x;
-								actorTest->_lastPos.z = processActor.z - actor->_collisionPos.z;
-							}
-						}
-
-						if ((actorTest->_boudingBox.maxs.x - actorTest->_boudingBox.mins.x == actorTest->_boudingBox.maxs.z - actorTest->_boudingBox.mins.z) &&
-							(actor->_boudingBox.maxs.x - actor->_boudingBox.mins.x == actor->_boudingBox.maxs.z - actor->_boudingBox.mins.z)) {
-							if (newAngle < ANGLE_135) {
-								processActor.x = minsTest.x - actor->_boudingBox.maxs.x;
-							}
-							if (newAngle >= ANGLE_135 && newAngle < ANGLE_225) {
-								processActor.z = maxsTest.z - actor->_boudingBox.mins.z;
-							}
-							if (newAngle >= ANGLE_225 && newAngle < ANGLE_315) {
-								processActor.x = maxsTest.x - actor->_boudingBox.mins.x;
-							}
-							if (newAngle >= ANGLE_315 || (newAngle < ANGLE_315 && newAngle < ANGLE_45)) {
-								processActor.z = minsTest.z - actor->_boudingBox.maxs.z;
-							}
-						} else {
-							if (!actor->_dynamicFlags.bIsFalling) {
-								processActor = previousActor;
-							}
-						}
+						handlePushing(minsTest, maxsTest, actor, actorTest);
 					}
 				} else {
 					if (standingOnActor(actorIdx, a)) {
 						_engine->_actor->hitActor(actorIdx, a, 1, -1);
 					}
-
-					int32 newAngle = _engine->_movements->getAngleAndSetTargetActorDistance(processActor, actorTest->pos());
-
-					if (actorTest->_staticFlags.bCanBePushed && !actor->_staticFlags.bCanBePushed) {
-						actorTest->_lastPos.y = 0;
-
-						if (actorTest->_staticFlags.bUseMiniZv) {
-							if (newAngle >= ANGLE_45 && newAngle < ANGLE_135 && actor->_angle > ANGLE_45 && actor->_angle < ANGLE_135) {
-								actorTest->_lastPos.x = 192;
-							}
-							if (newAngle >= ANGLE_135 && newAngle < ANGLE_225 && actor->_angle > ANGLE_135 && actor->_angle < ANGLE_225) {
-								actorTest->_lastPos.z = -64;
-							}
-							if (newAngle >= ANGLE_225 && newAngle < ANGLE_315 && actor->_angle > ANGLE_225 && actor->_angle < ANGLE_315) {
-								actorTest->_lastPos.x = -64;
-							}
-							if ((newAngle >= ANGLE_315 || newAngle < ANGLE_45) && (actor->_angle > ANGLE_315 || actor->_angle < ANGLE_45)) {
-								actorTest->_lastPos.x = 192;
-							}
-						} else {
-							actorTest->_lastPos.x = processActor.x - actor->_collisionPos.x;
-							actorTest->_lastPos.z = processActor.z - actor->_collisionPos.z;
-						}
-					}
-
-					if ((actorTest->_boudingBox.maxs.x - actorTest->_boudingBox.mins.x == actorTest->_boudingBox.maxs.z - actorTest->_boudingBox.mins.z) &&
-						(actor->_boudingBox.maxs.x - actor->_boudingBox.mins.x == actor->_boudingBox.maxs.z - actor->_boudingBox.mins.z)) {
-						if (newAngle < ANGLE_135) {
-							processActor.x = minsTest.x - actor->_boudingBox.maxs.x;
-						}
-						if (newAngle >= ANGLE_135 && newAngle < ANGLE_225) {
-							processActor.z = maxsTest.z - actor->_boudingBox.mins.z;
-						}
-						if (newAngle >= ANGLE_225 && newAngle < ANGLE_315) {
-							processActor.x = maxsTest.x - actor->_boudingBox.mins.x;
-						}
-						if (newAngle >= ANGLE_315 || (newAngle < ANGLE_315 && newAngle < ANGLE_45)) {
-							processActor.z = minsTest.z - actor->_boudingBox.maxs.z;
-						}
-					} else {
-						if (!actor->_dynamicFlags.bIsFalling) {
-							processActor = previousActor;
-						}
-					}
+					handlePushing(minsTest, maxsTest, actor, actorTest);
 				}
 			}
 		}
diff --git a/engines/twine/scene/collision.h b/engines/twine/scene/collision.h
index a8a9b6a105..1b26fd0dd9 100644
--- a/engines/twine/scene/collision.h
+++ b/engines/twine/scene/collision.h
@@ -34,6 +34,7 @@ class Collision {
 private:
 	TwinEEngine *_engine;
 
+	void handlePushing(const IVec3 &minsTest, const IVec3 &maxsTest, ActorStruct *actor, ActorStruct *actorTest);
 public:
 	Collision(TwinEEngine *engine);
 	/** Actor collision coordinate */


Commit: bf6672df34f7aeeaa652445daf930446f85ac266
    https://github.com/scummvm/scummvm/commit/bf6672df34f7aeeaa652445daf930446f85ac266
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-08-15T20:00:49+02:00

Commit Message:
TWINE: minor cleanup

Changed paths:
    engines/twine/scene/collision.cpp
    engines/twine/scene/collision.h


diff --git a/engines/twine/scene/collision.cpp b/engines/twine/scene/collision.cpp
index 644c5ea15a..e77b61cb9f 100644
--- a/engines/twine/scene/collision.cpp
+++ b/engines/twine/scene/collision.cpp
@@ -192,9 +192,9 @@ void Collision::reajustActorPosition(ShapeType brickShape) {
 	}
 }
 
-void Collision::handlePushing(const IVec3 &minsTest, const IVec3 &maxsTest, ActorStruct *actor, ActorStruct *actorTest) {
+void Collision::handlePushing(const IVec3 &minsTest, const IVec3 &maxsTest, const ActorStruct *actor, ActorStruct *actorTest) {
 	IVec3 &processActor = _engine->_movements->_processActor;
-	IVec3 &previousActor = _engine->_movements->_previousActor;
+	const IVec3 &previousActor = _engine->_movements->_previousActor;
 
 	const int32 newAngle = _engine->_movements->getAngleAndSetTargetActorDistance(processActor, actorTest->pos());
 
@@ -234,10 +234,8 @@ void Collision::handlePushing(const IVec3 &minsTest, const IVec3 &maxsTest, Acto
 		if (newAngle >= ANGLE_315 || (newAngle < ANGLE_315 && newAngle < ANGLE_45)) {
 			processActor.z = minsTest.z - actor->_boudingBox.maxs.z;
 		}
-	} else {
-		if (!actor->_dynamicFlags.bIsFalling) {
-			processActor = previousActor;
-		}
+	} else if (!actor->_dynamicFlags.bIsFalling) {
+		processActor = previousActor;
 	}
 }
 
diff --git a/engines/twine/scene/collision.h b/engines/twine/scene/collision.h
index 1b26fd0dd9..653a91bf22 100644
--- a/engines/twine/scene/collision.h
+++ b/engines/twine/scene/collision.h
@@ -34,7 +34,7 @@ class Collision {
 private:
 	TwinEEngine *_engine;
 
-	void handlePushing(const IVec3 &minsTest, const IVec3 &maxsTest, ActorStruct *actor, ActorStruct *actorTest);
+	void handlePushing(const IVec3 &minsTest, const IVec3 &maxsTest, const ActorStruct *actor, ActorStruct *actorTest);
 public:
 	Collision(TwinEEngine *engine);
 	/** Actor collision coordinate */


Commit: 9f9bf386f8b0eae720da53ab9d54532b8e535e60
    https://github.com/scummvm/scummvm/commit/9f9bf386f8b0eae720da53ab9d54532b8e535e60
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-08-15T20:00:49+02:00

Commit Message:
TWINE: fixed #12804 - scene 35 is solvable now

Changed paths:
    engines/twine/scene/collision.cpp


diff --git a/engines/twine/scene/collision.cpp b/engines/twine/scene/collision.cpp
index e77b61cb9f..7ec14d4750 100644
--- a/engines/twine/scene/collision.cpp
+++ b/engines/twine/scene/collision.cpp
@@ -212,7 +212,7 @@ void Collision::handlePushing(const IVec3 &minsTest, const IVec3 &maxsTest, cons
 				actorTest->_lastPos.x = -64;
 			}
 			if ((newAngle >= ANGLE_315 || newAngle < ANGLE_45) && (actor->_angle > ANGLE_315 || actor->_angle < ANGLE_45)) {
-				actorTest->_lastPos.x = 192;
+				actorTest->_lastPos.z = 192;
 			}
 		} else {
 			actorTest->_lastPos.x = processActor.x - actor->_collisionPos.x;




More information about the Scummvm-git-logs mailing list