From b97c417101be122753c4cce8b528306dbe958b68 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 13 May 2006 21:22:08 +0000 Subject: [PATCH] - Fixed: P_StartScript was missing a NULL pointer check for the error message. When trying to puke a script outside a map it crashed. - Fixed: The random number generator for large numbers must mask out the sign bit before performing a modulo. - Now that the conversation states are pointers there is no need to make AActor::ConversationAnimation virtual. No class overrides this method anymore. - Replaced AMacil1::TakeSpecialDamage with MF5_NODAMAGE. - Fixed: AMacil2::TakeSpecialDamage and AOracle::TakeSpecialDamage didn't check whether inflictor was NULL and crashed when used with 'kill monsters'. - Fixed: Some Strife decorations didn't loop their animation SVN r113 (trunk) --- docs/rh-log.txt | 11 +++++++++++ src/actor.h | 2 +- src/d_main.cpp | 4 ++-- src/g_strife/a_macil.cpp | 27 ++++---------------------- src/g_strife/a_oracle.cpp | 2 +- src/m_random.cpp | 2 +- src/p_acs.cpp | 2 +- src/p_setup.cpp | 2 +- src/version.h | 1 + src/win32/hardware.cpp | 1 + wadsrc/decorate/doom/doomartifacts.txt | 1 + wadsrc/decorate/strife/strifestuff.txt | 4 ++-- 12 files changed, 27 insertions(+), 32 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 4a9744b87..987b97a5b 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,15 @@ May 13, 2006 (Changes by Graf Zahl) +- Fixed: P_StartScript was missing a NULL pointer check for the error + message. When trying to puke a script outside a map it crashed. +- Fixed: The random number generator for large numbers must mask out the + sign bit before performing a modulo. +- Now that the conversation states are pointers there is no need to make + AActor::ConversationAnimation virtual. No class overrides this method + anymore. +- Replaced AMacil1::TakeSpecialDamage with MF5_NODAMAGE. +- Fixed: AMacil2::TakeSpecialDamage and AOracle::TakeSpecialDamage didn't + check whether inflictor was NULL and crashed when used with 'kill monsters'. +- Fixed: Some Strife decorations didn't loop their animation - Changed: The decision whether blood splatter sprites are spawned is no longer determined by game. Instead there's a new flag, MF5_BLOODSPLATTER which is deciding what to do. To keep backwards compatibility this flag diff --git a/src/actor.h b/src/actor.h index a333826fb..da3fc4fe8 100644 --- a/src/actor.h +++ b/src/actor.h @@ -555,7 +555,7 @@ public: void SetShade (int r, int g, int b); // Plays a conversation animation - virtual void ConversationAnimation (int animnum); + void ConversationAnimation (int animnum); // Make this actor hate the same things as another actor void CopyFriendliness (const AActor *other, bool changeTarget); diff --git a/src/d_main.cpp b/src/d_main.cpp index d0132ff21..b70e4c778 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -1863,10 +1863,10 @@ void D_DoomMain (void) // [RH] Make sure zdoom.pk3 is always loaded, // as it contains magic stuff we need. - wad = BaseFileSearch ("zdoom.pk3", NULL, true); + wad = BaseFileSearch (BASEWAD, NULL, true); if (wad == NULL) { - I_FatalError ("Cannot find zdoom.pk3"); + I_FatalError ("Cannot find " BASEWAD); } I_SetTitleString (IWADTypeNames[IdentifyVersion(wad)]); diff --git a/src/g_strife/a_macil.cpp b/src/g_strife/a_macil.cpp index 4359390dc..89430c726 100644 --- a/src/g_strife/a_macil.cpp +++ b/src/g_strife/a_macil.cpp @@ -17,7 +17,6 @@ class AMacil1 : public AStrifeHumanoid DECLARE_ACTOR (AMacil1, AStrifeHumanoid) public: void NoBlockingSet (); - int TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, int damagetype); }; FState AMacil1::States[] = @@ -91,6 +90,7 @@ IMPLEMENT_ACTOR (AMacil1, Strife, 64, 0) PROP_Flags2 (MF2_FLOORCLIP|MF2_PASSMOBJ|MF2_PUSHWALL|MF2_MCROSS) PROP_Flags3 (MF3_ISMONSTER) PROP_Flags4 (MF4_FIRERESIST|MF4_NOICEDEATH|MF4_NOSPLASHALERT) + PROP_Flags5 (MF5_NODAMAGE) PROP_MinMissileChance (150) PROP_RadiusFixed (20) PROP_HeightFixed (56) @@ -112,25 +112,6 @@ void AMacil1::NoBlockingSet () P_DropItem (this, "BoxOfBullets", -1, 256); } -//============================================================================ -// -// AMacil1 :: TakeSpecialDamage -// -// Before you storm the castle, Macil is a god and unkillable. The effort -// required to take the castle apparently drops him to mere godlike status. -// -//============================================================================ - -int AMacil1::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, int damagetype) -{ - target = source; - if (PainState != NULL) - { - SetState (PainState); - } - return -1; -} - // Macil (version 2) --------------------------------------------------------- class AMacil2 : public AMacil1 @@ -153,6 +134,7 @@ IMPLEMENT_STATELESS_ACTOR (AMacil2, Strife, 200, 0) PROP_Flags2 (MF2_FLOORCLIP|MF2_PASSMOBJ|MF2_PUSHWALL|MF2_MCROSS) PROP_Flags4Clear (MF4_FIRERESIST) PROP_Flags4Set (MF4_SPECTRAL) + PROP_Flags5Clear (MF5_NODAMAGE) PROP_MinMissileChance (150) PROP_Tag ("MACIL") PROP_DeathSound ("macil/slop") @@ -181,9 +163,8 @@ void AMacil2::NoBlockingSet () int AMacil2::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, int damagetype) { - if (inflictor->IsKindOf (RUNTIME_CLASS(ASpectralLightningV1))) + if (inflictor != NULL && inflictor->IsKindOf (RUNTIME_CLASS(ASpectralLightningV1))) return -1; - // This must skip the method of AMacil1 but it should call AActor's version. - return AActor::TakeSpecialDamage(inflictor, source, damage, damagetype); + return Super::TakeSpecialDamage(inflictor, source, damage, damagetype); } diff --git a/src/g_strife/a_oracle.cpp b/src/g_strife/a_oracle.cpp index 9ed0b9f29..8025ad0db 100644 --- a/src/g_strife/a_oracle.cpp +++ b/src/g_strife/a_oracle.cpp @@ -81,7 +81,7 @@ void A_WakeOracleSpectre (AActor *self) int AOracle::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, int damagetype) { - if (inflictor->IsKindOf (RUNTIME_CLASS(ASpectralLightningV1))) + if (inflictor != NULL && inflictor->IsKindOf (RUNTIME_CLASS(ASpectralLightningV1))) return -1; return Super::TakeSpecialDamage(inflictor, source, damage, damagetype); } diff --git a/src/m_random.cpp b/src/m_random.cpp index c6b5e36a7..f96148b12 100644 --- a/src/m_random.cpp +++ b/src/m_random.cpp @@ -139,7 +139,7 @@ int FRandom::operator() (int mod) num = (num << 8) | (*this)(); num = (num << 8) | (*this)(); num = (num << 8) | (*this)(); - return num % mod; + return (num&0x7fffffff) % mod; } } diff --git a/src/p_acs.cpp b/src/p_acs.cpp index ffa9983a6..76c43ae6a 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -4567,7 +4567,7 @@ int P_StartScript (AActor *who, line_t *where, int script, char *map, bool backS } else { - if (!net || who->player == &players[consoleplayer]) + if (!net || (who && who->player == &players[consoleplayer])) { Printf ("P_StartScript: Unknown script %d\n", script); } diff --git a/src/p_setup.cpp b/src/p_setup.cpp index ab2152145..958df5e11 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -2746,7 +2746,7 @@ static void P_InitTagLists () } } -static void P_GetPolySpots (int lump, TArray &spots, TArray &anchors) +void P_GetPolySpots (int lump, TArray &spots, TArray &anchors) { if (HasBehavior) { diff --git a/src/version.h b/src/version.h index 10e987e04..0ac935f48 100644 --- a/src/version.h +++ b/src/version.h @@ -66,6 +66,7 @@ // This is so that derivates can use the same savegame versions without worrying about engine compatibility #define GAMESIG "ZDOOM" +#define BASEWAD "zdoom.pk3" // MINSAVEVER is the minimum level snapshot version that can be loaded. #define MINSAVEVER 232 // Used by 2.0.99 diff --git a/src/win32/hardware.cpp b/src/win32/hardware.cpp index c523c08b6..8cccb885f 100644 --- a/src/win32/hardware.cpp +++ b/src/win32/hardware.cpp @@ -244,3 +244,4 @@ CCMD (vid_currentmode) { Printf ("%dx%dx%d\n", DisplayWidth, DisplayHeight, DisplayBits); } + diff --git a/wadsrc/decorate/doom/doomartifacts.txt b/wadsrc/decorate/doom/doomartifacts.txt index 4262d68e9..0b7d2e68d 100644 --- a/wadsrc/decorate/doom/doomartifacts.txt +++ b/wadsrc/decorate/doom/doomartifacts.txt @@ -75,6 +75,7 @@ ACTOR RadSuit : PowerupGiver 2025 +INVENTORY.AUTOACTIVATE +INVENTORY.ALWAYSPICKUP Inventory.MaxAmount 0 + Inventory.PickupMessage "$GOTSUIT" Powerup.Type IronFeet States { diff --git a/wadsrc/decorate/strife/strifestuff.txt b/wadsrc/decorate/strife/strifestuff.txt index b56abf6ee..57e36c453 100644 --- a/wadsrc/decorate/strife/strifestuff.txt +++ b/wadsrc/decorate/strife/strifestuff.txt @@ -571,7 +571,7 @@ ACTOR WaterFountain 112 Spawn: WTFT ABC 4 WTFT D 4 A_LoopActiveSound - Stop + Loop } } @@ -763,7 +763,7 @@ ACTOR BurningBrazier 106 { Spawn: BRAZ ABCD 4 Bright - Stop + Loop } }