[Scummvm-git-logs] scummvm master -> 5c51993959144249709a39b35def53651911d9a9
mgerhardy
noreply at scummvm.org
Sat Oct 12 18:10:32 UTC 2024
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:
5c51993959 TWINE: Reverted "use addLife even for hit damage"
Commit: 5c51993959144249709a39b35def53651911d9a9
https://github.com/scummvm/scummvm/commit/5c51993959144249709a39b35def53651911d9a9
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-12T20:10:25+02:00
Commit Message:
TWINE: Reverted "use addLife even for hit damage"
This reverts commit 5b33f309ae9502c09ea4d6fac3dbaa4a87a81ac4.
see bug https://bugs.scummvm.org/ticket/15401
also revert an accidental change from cd03d7e8b671dbeb5a05a07338fa5348f2bb54f1
that caused this issue, too
Changed paths:
engines/twine/scene/actor.cpp
engines/twine/scene/actor.h
engines/twine/twine.cpp
diff --git a/engines/twine/scene/actor.cpp b/engines/twine/scene/actor.cpp
index 7a2167982a9..5c3a1d500af 100644
--- a/engines/twine/scene/actor.cpp
+++ b/engines/twine/scene/actor.cpp
@@ -404,7 +404,10 @@ void Actor::hitObj(int32 actorIdx, int32 actorIdxAttacked, int32 hitforce, int32
_engine->_movements->_lastJoyFlag = true;
}
- actor->addLife(-hitforce);
+ actor->_lifePoint -= hitforce;
+ if (actor->_lifePoint < 0) {
+ actor->_lifePoint = 0;
+ }
} else {
_engine->_animations->initAnim(AnimationTypes::kHit, AnimType::kAnimationInsert, AnimationTypes::kAnimInvalid, actorIdxAttacked);
}
diff --git a/engines/twine/scene/actor.h b/engines/twine/scene/actor.h
index ab8364533ca..04d0e95b9c3 100644
--- a/engines/twine/scene/actor.h
+++ b/engines/twine/scene/actor.h
@@ -263,8 +263,6 @@ inline void ActorStruct::setLife(int32 val) {
_lifePoint = val;
if (_lifePoint > _maxLife) {
_lifePoint = _maxLife;
- } else if (_lifePoint < 0) {
- _lifePoint = 0;
}
}
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index 3d83eb8ebbd..465e365e309 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -1071,7 +1071,7 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
continue;
}
- if (actor->_lifePoint <= 0) {
+ if (actor->_lifePoint == 0) {
if (IS_HERO(a)) {
_animations->initAnim(AnimationTypes::kLandDeath, AnimType::kAnimationSet, AnimationTypes::kStanding, OWN_ACTOR_SCENE_INDEX);
actor->_controlMode = ControlMode::kNoMove;
More information about the Scummvm-git-logs
mailing list