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

dreammaster paulfgilbert at gmail.com
Sun Sep 13 00:57:30 UTC 2020


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:
d9926ba5bb XEEN: Fix attributes going negative


Commit: d9926ba5bb746b6af77bd1c7c69753bca3fb6e43
    https://github.com/scummvm/scummvm/commit/d9926ba5bb746b6af77bd1c7c69753bca3fb6e43
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-09-12T17:57:16-07:00

Commit Message:
XEEN: Fix attributes going negative

Changed paths:
    NEWS.md
    engines/xeen/character.cpp
    engines/xeen/character.h


diff --git a/NEWS.md b/NEWS.md
index 7f69fe5a16..f475953bf5 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -130,6 +130,8 @@ For a more comprehensive changelog of the latest experimental code, see:
    - Fix loading of wall items from savegames.
    - Fix U/D keys not working on Quests dialog
    - Fix incorrect mirror destination for Dragon Tower
+   - Fix crash reading book in Great Pyramid safe
+   - Prevent attributes from going negative
 
  ZVision:
    - Fixed regression in the safe puzzle in Zork Nemesis: The Forbidden Lands.
diff --git a/engines/xeen/character.cpp b/engines/xeen/character.cpp
index 6b4ca056dc..78ff5f1eae 100644
--- a/engines/xeen/character.cpp
+++ b/engines/xeen/character.cpp
@@ -403,7 +403,7 @@ uint Character::getStat(Attribute attrib, bool baseOnly) const {
 		attr._permanent += attr._temporary;
 	}
 
-	return MAX(attr._permanent, (uint)0);
+	return MAX(attr._permanent, 0);
 }
 
 int Character::statColor(int amount, int threshold) {
@@ -550,7 +550,7 @@ int Character::getThievery() const {
 }
 
 uint Character::getCurrentLevel() const {
-	return MAX(_level._permanent + _level._temporary, (uint)0);
+	return MAX(_level._permanent + _level._temporary, 0);
 }
 
 int Character::itemScan(int itemId) const {
diff --git a/engines/xeen/character.h b/engines/xeen/character.h
index 5181f0f59f..38760445f9 100644
--- a/engines/xeen/character.h
+++ b/engines/xeen/character.h
@@ -92,8 +92,8 @@ class XeenEngine;
 
 class AttributePair {
 public:
-	uint _permanent;
-	uint _temporary;
+	int _permanent;
+	int _temporary;
 public:
 	AttributePair();
 	void synchronize(Common::Serializer &s);




More information about the Scummvm-git-logs mailing list