[Scummvm-git-logs] scummvm master -> 161a318e499aab872d7f9cad0061253004439e43

scemino noreply at scummvm.org
Thu Jan 16 20:52:26 UTC 2025


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:
161a318e49 TWP: Fix verb is not always executed


Commit: 161a318e499aab872d7f9cad0061253004439e43
    https://github.com/scummvm/scummvm/commit/161a318e499aab872d7f9cad0061253004439e43
Author: scemino (scemino74 at gmail.com)
Date: 2025-01-16T21:52:16+01:00

Commit Message:
TWP: Fix verb is not always executed

Fix #15627

Changed paths:
    engines/twp/savegame.cpp
    engines/twp/twp.cpp


diff --git a/engines/twp/savegame.cpp b/engines/twp/savegame.cpp
index 3c76c732e2a..7c290a9a3ff 100644
--- a/engines/twp/savegame.cpp
+++ b/engines/twp/savegame.cpp
@@ -455,6 +455,8 @@ bool SaveGameManager::loadGame(Common::SeekableReadStream &stream) {
 		return false;
 	}
 	g_twp->_time = (float)gameTime;
+	// reset _nextHoldToMoveTime because it's based on time
+	g_twp->_nextHoldToMoveTime = 0.f;
 	g_twp->setTotalPlayTime(gameTime * 1000);
 	g_twp->_inputState.setState((InputStateFlag)json["inputState"]->asIntegerNumber());
 	if (SQ_FAILED(loadObjects(json["objects"]->asObject()))) {
diff --git a/engines/twp/twp.cpp b/engines/twp/twp.cpp
index e53cb623b2c..994165b48e3 100644
--- a/engines/twp/twp.cpp
+++ b/engines/twp/twp.cpp
@@ -566,11 +566,17 @@ void TwpEngine::update(float elapsed) {
 				if (_cursor.isLeftDown() || _cursor.isRightDown()) {
 					clickedAt(scrPos);
 				} else if (_cursor.leftDown || _cursor.rightDown) {
+					// when we keep holding button down, the actor should continue to walk to where the cursor is
 					if (_holdToMove && (_time > _nextHoldToMoveTime)) {
 						walkFast();
-						cancelSentence(_actor);
+						// don't change destination too often or it will be too slow
 						if (_actor->_room == _room && (distance(_actor->_node->getAbsPos(), roomPos) > 5)) {
-							Object::walk(_actor, roomPos);
+							// if a sentence is currently in execution, don't change the destination
+							if (_actor->_exec.enabled && _actor->_exec.noun1) {
+								Object::walk(_actor, _actor->_exec.noun1);
+							} else {
+								Object::walk(_actor, roomPos);
+							}
 						}
 						_nextHoldToMoveTime = _time + 0.250f;
 					}




More information about the Scummvm-git-logs mailing list