[Scummvm-git-logs] scummvm branch-2-7 -> 5fec88e6b9bb24982827f50f051119785be1db7c

sev- noreply at scummvm.org
Wed Mar 1 18:06:58 UTC 2023


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:
85d2b9a8e6 SAGA2: fix wrong spellid crash
5fec88e6b9 NEWS: Mention SAGA2 fix


Commit: 85d2b9a8e66d36ce4b082aebc216e4e46fe242b5
    https://github.com/scummvm/scummvm/commit/85d2b9a8e66d36ce4b082aebc216e4e46fe242b5
Author: Harishankar Kumar (hari01584 at gmail.com)
Date: 2023-03-01T19:05:34+01:00

Commit Message:
SAGA2: fix wrong spellid crash

Changed paths:
    engines/saga2/magic.cpp


diff --git a/engines/saga2/magic.cpp b/engines/saga2/magic.cpp
index 2206ad7080c..0b7a319ef00 100644
--- a/engines/saga2/magic.cpp
+++ b/engines/saga2/magic.cpp
@@ -93,8 +93,15 @@ GameObject *GetOwner(GameObject *go) {
 // This call looks up a spells object prototype. It can accept either
 //   an object ID or a spell ID
 SkillProto *skillProtoFromID(int16 spellOrObjectID) {
+	SkillProto *sProto = (SkillProto *)GameObject::protoAddress(spellOrObjectID);
 	if (spellOrObjectID > MAX_SPELLS)
-		return (SkillProto *)GameObject::protoAddress(spellOrObjectID);
+		return sProto;
+
+	// Can be spellId, check if this the prototype returned by spellOrObjectID refers to a spell
+	int16 manaColor = spellBook[sProto->getSpellID()].getManaType();
+	int16 manaCost  = spellBook[sProto->getSpellID()].getManaAmt();
+	if (manaColor >= ksManaIDRed &&  manaColor <= ksManaIDViolet &&  manaCost > 0) // A spell
+		return sProto;
 
 	if (spellOrObjectID >= kTotalSpellBookPages)
 		error("Wrong spellID: %d > %d", spellOrObjectID, kTotalSpellBookPages);


Commit: 5fec88e6b9bb24982827f50f051119785be1db7c
    https://github.com/scummvm/scummvm/commit/5fec88e6b9bb24982827f50f051119785be1db7c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-03-01T19:06:13+01:00

Commit Message:
NEWS: Mention SAGA2 fix

Changed paths:
    NEWS.md


diff --git a/NEWS.md b/NEWS.md
index cbc88b1da4d..7a366fa7d80 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -9,6 +9,9 @@ For a more comprehensive changelog of the latest experimental code, see:
  HDB:
    - Fixed bug with inability to pick up red envelope with keyboard.
 
+ SAGA2:
+   - Fixed crash when hovering over certain spells.
+
  RISC OS port:
    - Fixed crash on RISC OS 5 with games that require lots of RAM.
 




More information about the Scummvm-git-logs mailing list