From 39d2ef0460c0a074724c62647b5094eadec8f680 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 15 Oct 2006 20:27:16 +0000 Subject: [PATCH] - Changed the rocket so that the FX_ROCKET flag is set in the actor definition and not in BeginPlay. - Changed the special explosion behavior of the rocket to a flag (MF5_DEHEXPLOSION) so that its effects can be used on other actors as well without having to inherit from the rocket. SVN r353 (trunk) --- docs/rh-log.txt | 7 +++++++ src/actor.h | 1 + src/g_doom/a_doomglobal.h | 1 - src/g_doom/a_doomweaps.cpp | 8 ++------ src/info.h | 1 + src/infodefaults.cpp | 1 + src/infomacros.h | 2 ++ src/p_mobj.cpp | 2 +- src/thingdef.cpp | 1 + 9 files changed, 16 insertions(+), 8 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 8c7f97f867..fd80e0db3a 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,10 @@ +October 15, 2006 (Changes by Graf Zahl) +- Changed the rocket so that the FX_ROCKET flag is set in the actor + definition and not in BeginPlay. +- Changed the special explosion behavior of the rocket to a flag + (MF5_DEHEXPLOSION) so that its effects can be used on other actors + as well without having to inherit from the rocket. + October 7, 2006 (Changes by Graf Zahl) - Fixed: PrintAlias passed FString objects directly to Printf. - Added bitwise not (~) operator to ACS. diff --git a/src/actor.h b/src/actor.h index 8fccb379a2..d5066de1b3 100644 --- a/src/actor.h +++ b/src/actor.h @@ -283,6 +283,7 @@ enum MF5_CHASEGOAL = 0x00000080, // Walks to goal instead of target if a valid goal is set. MF5_BLOODSPLATTER = 0x00000100, // Blood splatter like in Raven's games. MF5_OLDRADIUSDMG = 0x00000200, // Use old radius damage code (for barrels and boss brain) + MF5_DEHEXPLOSION = 0x00000400, // Use the DEHACKED explosion options when this projectile explodes // --- mobj.renderflags --- diff --git a/src/g_doom/a_doomglobal.h b/src/g_doom/a_doomglobal.h index e459a2cc2c..b6f1928129 100644 --- a/src/g_doom/a_doomglobal.h +++ b/src/g_doom/a_doomglobal.h @@ -26,7 +26,6 @@ class ARocket : public AActor { DECLARE_ACTOR (ARocket, AActor) public: - void BeginPlay (); }; class AArchvile : public AActor diff --git a/src/g_doom/a_doomweaps.cpp b/src/g_doom/a_doomweaps.cpp index 93cb6d6e0f..faa7a380e3 100644 --- a/src/g_doom/a_doomweaps.cpp +++ b/src/g_doom/a_doomweaps.cpp @@ -706,6 +706,8 @@ IMPLEMENT_ACTOR (ARocket, Doom, -1, 127) PROP_Flags (MF_NOBLOCKMAP|MF_MISSILE|MF_DROPOFF|MF_NOGRAVITY) PROP_Flags2 (MF2_PCROSS|MF2_IMPACT|MF2_NOTELEPORT) PROP_Flags4 (MF4_RANDOMIZE) + PROP_Flags5 (MF5_DEHEXPLOSION) + PROP_FXFlags (FX_ROCKET) PROP_SpawnState (S_ROCKET) PROP_DeathState (S_EXPLODE) @@ -715,12 +717,6 @@ IMPLEMENT_ACTOR (ARocket, Doom, -1, 127) PROP_Obituary("$OB_MPROCKET") END_DEFAULTS -void ARocket::BeginPlay () -{ - Super::BeginPlay (); - effects |= FX_ROCKET; -} - // // A_FireMissile // diff --git a/src/info.h b/src/info.h index 275a735e86..341247515f 100644 --- a/src/info.h +++ b/src/info.h @@ -287,6 +287,7 @@ enum ADEF_BounceCount, ADEF_FloatSpeed, ADEF_RDFactor, + ADEF_FXFlags, ADEF_SpawnState, ADEF_SeeState, diff --git a/src/infodefaults.cpp b/src/infodefaults.cpp index 0166c519fd..77d0e36712 100644 --- a/src/infodefaults.cpp +++ b/src/infodefaults.cpp @@ -230,6 +230,7 @@ static void ApplyActorDefault (int defnum, const char *datastr, int dataint) case ADEF_BounceFactor: actor->bouncefactor = dataint; break; case ADEF_BounceCount: actor->bouncecount = dataint; break; case ADEF_RDFactor: sgClass->Meta.SetMetaFixed (AMETA_RDFactor, dataint); break; + case ADEF_FXFlags: actor->effects = dataint; break; case ADEF_SpawnState: actor->SpawnState = datastate; break; case ADEF_SeeState: actor->SeeState = datastate; break; diff --git a/src/infomacros.h b/src/infomacros.h index b10e1fa246..9c40e5f2af 100644 --- a/src/infomacros.h +++ b/src/infomacros.h @@ -264,6 +264,8 @@ public: #define PROP_BounceFactor(x) ADD_LONG_PROP(ADEF_BounceFactor,x) #define PROP_BounceCount(x) ADD_LONG_PROP(ADEF_BounceCount,x) #define PROP_RadiusdamageFactor(x) ADD_LONG_PROP(ADEF_RDFactor,x) +#define PROP_FXFlags(x) ADD_LONG_PROP(ADEF_FXFlags,x) + #define PROP_SpawnState(x) ADD_BYTE_PROP(ADEF_SpawnState,x) #define PROP_SeeState(x) ADD_BYTE_PROP(ADEF_SeeState,x) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index adcfaa13ab..203b6737c8 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -1078,7 +1078,7 @@ void P_ExplodeMissile (AActor *mo, line_t *line) if (mo->DeathState != NULL) { // [RH] Change render style of exploding rockets - if (mo->IsKindOf (RUNTIME_CLASS(ARocket))) + if (mo->flags5 & MF5_DEHEXPLOSION) { if (deh.ExplosionStyle == 255) { diff --git a/src/thingdef.cpp b/src/thingdef.cpp index 0573ed9ba4..d848aed4d4 100644 --- a/src/thingdef.cpp +++ b/src/thingdef.cpp @@ -219,6 +219,7 @@ static flagdef ActorFlags[]= DEFINE_FLAG(MF5, NODAMAGE, AActor, flags5), DEFINE_FLAG(MF5, BLOODSPLATTER, AActor, flags5), DEFINE_FLAG(MF5, OLDRADIUSDMG, AActor, flags5), + DEFINE_FLAG(MF5, DEHEXPLOSION, AActor, flags5), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),