[Scummvm-git-logs] scummvm master -> 59c27136f37686345d82b44dd86496f12de398d5

OMGPizzaGuy noreply at scummvm.org
Thu May 16 03:05:16 UTC 2024


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

Summary:
f72dc1cf0b UTLIMA8: Shake head twice after stun
59c27136f3 ULTIMA8: Prevent animation from damage when fallen.


Commit: f72dc1cf0bed468820c4acd6fe13d0be3986994d
    https://github.com/scummvm/scummvm/commit/f72dc1cf0bed468820c4acd6fe13d0be3986994d
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2024-05-15T22:04:53-05:00

Commit Message:
UTLIMA8: Shake head twice after stun
This appear to match original game behavior after stand up

Changed paths:
    engines/ultima/ultima8/world/actors/avatar_mover_process.cpp


diff --git a/engines/ultima/ultima8/world/actors/avatar_mover_process.cpp b/engines/ultima/ultima8/world/actors/avatar_mover_process.cpp
index f569f8c610f..9e8d2a2f3f3 100644
--- a/engines/ultima/ultima8/world/actors/avatar_mover_process.cpp
+++ b/engines/ultima/ultima8/world/actors/avatar_mover_process.cpp
@@ -146,6 +146,8 @@ bool AvatarMoverProcess::standUpIfNeeded(Direction direction) {
 			ProcId pid = avatar->doAnim(Animation::standUp, direction);
 			if (avatar->hasActorFlags(Actor::ACT_STUNNED)) {
 				avatar->clearActorFlag(Actor::ACT_STUNNED);
+				// Shake head twice
+				pid = avatar->doAnimAfter(Animation::shakeHead, direction, pid);
 				pid = avatar->doAnimAfter(Animation::shakeHead, direction, pid);
 			}
 			waitFor(pid);


Commit: 59c27136f37686345d82b44dd86496f12de398d5
    https://github.com/scummvm/scummvm/commit/59c27136f37686345d82b44dd86496f12de398d5
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2024-05-15T22:04:53-05:00

Commit Message:
ULTIMA8: Prevent animation from damage when fallen.
This fixes damage taken and death when asleep due to drinking a blue potion. Fixes #14044

Changed paths:
    engines/ultima/ultima8/usecode/uc_process.h
    engines/ultima/ultima8/world/actors/actor.cpp


diff --git a/engines/ultima/ultima8/usecode/uc_process.h b/engines/ultima/ultima8/usecode/uc_process.h
index ff0939126ff..e9a5ad321f5 100644
--- a/engines/ultima/ultima8/usecode/uc_process.h
+++ b/engines/ultima/ultima8/usecode/uc_process.h
@@ -52,6 +52,10 @@ public:
 		_temp32 = retval;
 	}
 
+	uint16 getClassId() const {
+		return _classId;
+	}
+
 	Common::String dumpInfo() const override;
 
 	bool loadData(Common::ReadStream *rs, uint32 version);
diff --git a/engines/ultima/ultima8/world/actors/actor.cpp b/engines/ultima/ultima8/world/actors/actor.cpp
index 31976713a84..03f455d85ab 100644
--- a/engines/ultima/ultima8/world/actors/actor.cpp
+++ b/engines/ultima/ultima8/world/actors/actor.cpp
@@ -26,6 +26,7 @@
 #include "ultima/ultima8/kernel/delay_process.h"
 #include "ultima/ultima8/usecode/uc_machine.h"
 #include "ultima/ultima8/usecode/uc_list.h"
+#include "ultima/ultima8/usecode/uc_process.h"
 #include "ultima/ultima8/misc/direction_util.h"
 #include "ultima/ultima8/games/game_data.h"
 #include "ultima/ultima8/world/fire_type.h"
@@ -1282,7 +1283,9 @@ void Actor::receiveHitU8(uint16 other, Direction dir, int damage, uint16 damage_
 		}
 	}
 
-	if (damage && !fallingprocid) {
+	if (damage && !fallingprocid &&
+		getLastAnim() != Animation::die &&
+		getLastAnim() != Animation::fallBackwards) {
 		ProcId anim1pid = doAnim(Animation::stumbleBackwards, dir);
 		ProcId anim2pid;
 		if (isInCombat())
@@ -1318,8 +1321,28 @@ ProcId Actor::dieU8(uint16 damageType) {
 	Kernel::get_instance()->killProcesses(getObjId(), Kernel::PROC_TYPE_ALL, true);
 #endif
 
-	if (!animprocid)
+	if (!animprocid &&
+		getLastAnim() != Animation::die &&
+		getLastAnim() != Animation::fallBackwards) {
 		animprocid = doAnim(Animation::die, dir_current);
+	}
+
+	// Kill blue potion use process if running
+	if (_objId == 1) {
+		ProcessIter iter = Kernel::get_instance()->getProcessBeginIterator();
+		ProcessIter endproc = Kernel::get_instance()->getProcessEndIterator();
+		for (; iter != endproc; ++iter) {
+			UCProcess *p = dynamic_cast<UCProcess *>(*iter);
+			if (!p)
+				continue;
+			if (p->getClassId() != 766) // Potion
+				continue;
+			if (p->is_terminated())
+				continue;
+
+			p->fail();
+		}
+	}
 
 	MainActor *avatar = getMainActor();
 	// if hostile to avatar




More information about the Scummvm-git-logs mailing list