diff --git a/docs/rh-log.txt b/docs/rh-log.txt index e234fee0f0..661718eb4c 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,5 @@ May 31, 2009 (Changes by Graf Zahl) +- Added Gez's THRUSPECIES submission. - Added loading directories into the lump directory. - fixed: The Dehacked parser could not parse flag values with the highest bit set because it used atoi to convert the string into a number. diff --git a/src/actor.h b/src/actor.h index 6069539e79..1b144a56ca 100644 --- a/src/actor.h +++ b/src/actor.h @@ -305,6 +305,8 @@ enum MF5_MOVEWITHSECTOR = 0x80000000, // P_ChangeSector() will still process this actor if it has MF_NOBLOCKMAP MF6_NOBOSSRIP = 0x00000001, // For rippermissiles: Don't rip through bosses. + MF6_THRUSPECIES = 0x00000002, // Actors passes through other of the same species. + MF6_MTHRUSPECIES = 0x00000004, // Missile passes through actors of its shooter's species. // --- mobj.renderflags --- diff --git a/src/p_map.cpp b/src/p_map.cpp index 3669d61f02..703e8ab4a4 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -755,6 +755,9 @@ bool PIT_CheckThing (AActor *thing, FCheckPosition &tm) if ((thing->flags2 | tm.thing->flags2) & MF2_THRUACTORS) return true; + if ((tm.thing->flags6 & MF6_THRUSPECIES) && (tm.thing->Species == thing->Species)) + return true; + if (!(thing->flags & (MF_SOLID|MF_SPECIAL|MF_SHOOTABLE)) ) return true; // can't hit thing @@ -836,6 +839,12 @@ bool PIT_CheckThing (AActor *thing, FCheckPosition &tm) { return true; } + + if ((tm.thing->flags6 & MF6_MTHRUSPECIES) + && tm.thing->target // NULL pointer check + && (tm.thing->target->GetSpecies() == thing->GetSpecies())) + return true; + // Check for rippers passing through corpses if ((thing->flags & MF_CORPSE) && (tm.thing->flags2 & MF2_RIP) && !(thing->flags & MF_SHOOTABLE)) { diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 9eb2286de2..941b0a1a75 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -5118,7 +5118,7 @@ FName AActor::GetSpecies() break; } } - return thistype->TypeName; + return Species = thistype->TypeName; // [GZ] Speeds up future calls. } //========================================================================== diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index c6b03fee4c..c1d91d618b 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -210,6 +210,8 @@ static FFlagDef ActorFlags[]= DEFINE_FLAG(MF5, MOVEWITHSECTOR, AActor, flags5), DEFINE_FLAG(MF6, NOBOSSRIP, AActor, flags6), + DEFINE_FLAG(MF6, THRUSPECIES, AActor, flags6), + DEFINE_FLAG(MF6, MTHRUSPECIES, AActor, flags6), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),