diff --git a/src/gamedata/d_dehacked.cpp b/src/gamedata/d_dehacked.cpp index ad62d1b61..f69ae6714 100644 --- a/src/gamedata/d_dehacked.cpp +++ b/src/gamedata/d_dehacked.cpp @@ -978,6 +978,17 @@ static int PatchThing (int thingy) if (grp < 0) grp = -1; type->ActorInfo()->projectile_group = grp; } + else if (linelen == 12 && stricmp(Line1, "splash group") == 0) + { + stripwhite(Line2); + int grp = atoi(Line2); + if (grp < 0) + { + Printf("Splash groups must be >= 0 (check your dehacked)\n"); + grp = 0; + } + type->ActorInfo()->splash_group = grp; + } else if (linelen > 6) { diff --git a/src/playsim/p_map.cpp b/src/playsim/p_map.cpp index 0e6e42ffe..757e8f9b1 100644 --- a/src/playsim/p_map.cpp +++ b/src/playsim/p_map.cpp @@ -5956,6 +5956,11 @@ int P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bom continue; } + // MBF21 + auto targetgroup = thing->GetClass()->ActorInfo()->splash_group; + auto sourcegroup = bombspot->GetClass()->ActorInfo()->splash_group; + if (targetgroup != 0 && targetgroup == sourcegroup) continue; + // a much needed option: monsters that fire explosive projectiles cannot // be hurt by projectiles fired by a monster of the same type. // Controlled by the DONTHARMCLASS and DONTHARMSPECIES flags. diff --git a/src/scripting/thingdef_properties.cpp b/src/scripting/thingdef_properties.cpp index 0367b8caf..64d44e669 100644 --- a/src/scripting/thingdef_properties.cpp +++ b/src/scripting/thingdef_properties.cpp @@ -1051,6 +1051,19 @@ DEFINE_PROPERTY(projectilegroup, I, Actor) info->ActorInfo()->projectile_group = i; } +//========================================================================== +// MBF21 +//========================================================================== +DEFINE_PROPERTY(splashgroup, I, Actor) +{ + PROP_INT_PARM(i, 0); + if (i < 0) + { + I_Error("Splash groups must be >= 0."); + } + info->ActorInfo()->splash_group = i; +} + //========================================================================== // [BB] //==========================================================================