From c4bda7e0beb855b9ba8b83dae61bf024c8df01d5 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 16 May 2006 22:31:58 +0000 Subject: [PATCH] - Fixed: ApplyActorDefault() must ensure that dataint is non-negative before calculating a non-NULL state. When compiling with Visual C++, states are stored in the defaults list as byte values, but when compiling with GCC, they are passed as 32-bit arguments to the function directly. So in VC++, using ~0 to specify a NULL state appears as 255, but in GCC, it appears as -1. SVN r121 (trunk) --- docs/rh-log.txt | 8 ++++++++ src/infodefaults.cpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 552deacd5..f05ac878d 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,11 @@ +May 16, 2006 +- Fixed: ApplyActorDefault() must ensure that dataint is non-negative before + calculating a non-NULL state. When compiling with Visual C++, states are + stored in the defaults list as byte values, but when compiling with GCC, + they are passed as 32-bit arguments to the function directly. So in VC++, + using ~0 to specify a NULL state appears as 255, but in GCC, it appears as + -1. + May 16, 2006 (Changes by Graf Zahl) - Added a missing NULL pointer check to APlayerPawn::Tick. - Fixed: The falling scream should not be played when the player is under diff --git a/src/infodefaults.cpp b/src/infodefaults.cpp index 60fc7ece7..7cf75ac2f 100644 --- a/src/infodefaults.cpp +++ b/src/infodefaults.cpp @@ -109,7 +109,7 @@ static void ApplyActorDefault (int defnum, const char *datastr, int dataint) datasound = S_FindSound (datastr); } } - else if (defnum > ADEF_LastString && dataint < 255) + else if (defnum > ADEF_LastString && dataint >= 0 && dataint < 255) { datastate = DefaultStates (sgClass) + dataint; }