[Scummvm-git-logs] scummvm master -> a9960cfea5ba666bbdc1935b8338ab91cca82dff

mgerhardy martin.gerhardy at gmail.com
Fri Jan 1 19:25:00 UTC 2021


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:
a9960cfea5 TWINE: fixed regression in manual attack mode


Commit: a9960cfea5ba666bbdc1935b8338ab91cca82dff
    https://github.com/scummvm/scummvm/commit/a9960cfea5ba666bbdc1935b8338ab91cca82dff
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-01T20:24:45+01:00

Commit Message:
TWINE: fixed regression in manual attack mode

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

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


diff --git a/engines/twine/scene/actor.cpp b/engines/twine/scene/actor.cpp
index d4d3e1afde..65592c220c 100644
--- a/engines/twine/scene/actor.cpp
+++ b/engines/twine/scene/actor.cpp
@@ -25,10 +25,10 @@
 #include "common/system.h"
 #include "common/textconsole.h"
 #include "twine/audio/sound.h"
-#include "twine/resources/hqr.h"
 #include "twine/parser/entity.h"
 #include "twine/renderer/renderer.h"
 #include "twine/renderer/screens.h"
+#include "twine/resources/hqr.h"
 #include "twine/resources/resources.h"
 #include "twine/scene/animations.h"
 #include "twine/scene/extra.h"
@@ -531,4 +531,8 @@ int32 ActorMoveStruct::getRealValue(int32 time) {
 	return tempStep + from;
 }
 
+bool ActorStruct::isAttackAnimationActive() const {
+	return anim == AnimationTypes::kRightPunch || anim == AnimationTypes::kLeftPunch || anim == AnimationTypes::kKick;
+}
+
 } // namespace TwinE
diff --git a/engines/twine/scene/actor.h b/engines/twine/scene/actor.h
index d01dd5b81e..1e81a6d08e 100644
--- a/engines/twine/scene/actor.h
+++ b/engines/twine/scene/actor.h
@@ -184,6 +184,8 @@ public:
 	uint8 *entityDataPtr = nullptr;
 	int32 entityDataSize = 0;
 
+	bool isAttackAnimationActive() const;
+
 	int32 x = 0;
 	int32 y = 0;
 	int32 z = 0;
diff --git a/engines/twine/scene/movements.cpp b/engines/twine/scene/movements.cpp
index 1354bab303..5b77ede90a 100644
--- a/engines/twine/scene/movements.cpp
+++ b/engines/twine/scene/movements.cpp
@@ -293,6 +293,9 @@ bool Movements::processAttackExecution(int actorIdx) {
 
 void Movements::processMovementExecution(int actorIdx) {
 	ActorStruct *actor = _engine->_scene->getActor(actorIdx);
+	if (_engine->_actor->autoAgressive && actor->isAttackAnimationActive()) {
+		return;
+	}
 	if (!changedCursorKeys || heroAction) {
 		// if walking should get stopped
 		if (!_engine->_input->isActionActive(TwinEActionType::MoveForward) && !_engine->_input->isActionActive(TwinEActionType::MoveBackward)) {
@@ -337,6 +340,9 @@ void Movements::processMovementExecution(int actorIdx) {
 
 void Movements::processRotationExecution(int actorIdx) {
 	ActorStruct *actor = _engine->_scene->getActor(actorIdx);
+	if (_engine->_actor->autoAgressive && actor->isAttackAnimationActive()) {
+		return;
+	}
 	int16 tempAngle;
 	if (_engine->_input->isActionActive(TwinEActionType::TurnLeft)) {
 		tempAngle = ANGLE_90;




More information about the Scummvm-git-logs mailing list