[Scummvm-git-logs] scummvm master -> 07a6b13ea878b206c376bc24fa4acef04f0e937f

mgerhardy noreply at scummvm.org
Mon May 25 07:23:57 UTC 2026


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

Summary:
07a6b13ea8 TWINE: fixed twinsen getting stuck in in a loop of throwing the magic ball


Commit: 07a6b13ea878b206c376bc24fa4acef04f0e937f
    https://github.com/scummvm/scummvm/commit/07a6b13ea878b206c376bc24fa4acef04f0e937f
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2026-05-25T09:22:55+02:00

Commit Message:
TWINE: fixed twinsen getting stuck in in a loop of throwing the magic ball

even though this is very hard to reproduce i've compared the original logic with
the one in scummvm and found out that _changedCursorKeys was handled wrong

https://bugs.scummvm.org/ticket/13675

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


diff --git a/engines/twine/scene/movements.cpp b/engines/twine/scene/movements.cpp
index bc6a7efce54..f00342ed904 100644
--- a/engines/twine/scene/movements.cpp
+++ b/engines/twine/scene/movements.cpp
@@ -237,8 +237,10 @@ void Movements::ChangedCursorKeys::update(TwinEEngine *engine) {
 void Movements::update() {
 	_previousChangedCursorKeys = _changedCursorKeys;
 	_previousLoopActionKey = _heroActionKey;
+	_previousLoopAttackKey = _heroAttackKey;
 
 	_heroActionKey = _engine->_input->isHeroActionActive();
+	_heroAttackKey = _engine->_input->isActionActive(TwinEActionType::ThrowMagicBall, false);
 	_changedCursorKeys.update(_engine);
 }
 
@@ -328,10 +330,11 @@ void Movements::processManualMovementExecution(int actorIdx) {
 	if (actor->isAttackWeaponAnimationActive()) {
 		return;
 	}
-	if (!_changedCursorKeys || _actionNormal) {
+	// Original: if (!MyFire OR ActionNormal) - skip movement when fire buttons are held
+	if ((!_heroActionKey && !_heroAttackKey) || _actionNormal) {
 		// if walking should get stopped
 		if (!_engine->_input->isActionActive(TwinEActionType::MoveForward) && !_engine->_input->isActionActive(TwinEActionType::MoveBackward)) {
-			if (_lastJoyFlag && (_heroActionKey != _previousLoopActionKey || _changedCursorKeys != _previousChangedCursorKeys)) {
+			if (_lastJoyFlag && (_heroActionKey != _previousLoopActionKey || _heroAttackKey != _previousLoopAttackKey || _changedCursorKeys != _previousChangedCursorKeys)) {
 				_engine->_animations->initAnim(AnimationTypes::kStanding, AnimType::kAnimationTypeRepeat, AnimationTypes::kNoAnim, actorIdx);
 			}
 		}
diff --git a/engines/twine/scene/movements.h b/engines/twine/scene/movements.h
index bf48fadb6e2..66903b7d567 100644
--- a/engines/twine/scene/movements.h
+++ b/engines/twine/scene/movements.h
@@ -63,6 +63,9 @@ private:
 	// enter, space, ...
 	int16 _heroActionKey = 0;
 	int32 _previousLoopActionKey = 0;
+	// alt (throw magic ball / sabre)
+	int16 _heroAttackKey = 0;
+	int32 _previousLoopAttackKey = 0;
 	// cursor keys
 	ChangedCursorKeys _changedCursorKeys;
 	ChangedCursorKeys _previousChangedCursorKeys;




More information about the Scummvm-git-logs mailing list