Page 1 of 1

A_Explode with XF_NOTMISSILE does not ignore DONTHARM* flags

PostPosted: Mon Jun 15, 2020 3:47 pm
by Accensus
Here's the situation:
I have this line right here. What this override does is it makes every poisoned enemy call A_Explode. So far so good, but some enemies have +DONTHARMSPECIES, which makes this attack do practically nothing on themselves or other nearby actors of the same species if XF_NOTMISSILE is supplied. Omitting it works as expected (by me).

Here are some actors to test with:
Code: Select allExpand view
class DoomImp1 : DoomImp
{
   Default
   {
      +DONTHARMCLASS
   }

   override void PostBeginPlay()
   {
      A_Explode (500, 260, XF_NOTMISSILE | XF_HURTSOURCE, false, 180);

      Super.PostBeginPlay();
   }
}

class DoomImp2 : DoomImp
{
   Default
   {
      Species "SomeImp";

      +DONTHARMSPECIES
   }

   override void PostBeginPlay()
   {
      A_Explode (500, 260, XF_NOTMISSILE | XF_HURTSOURCE, false, 180);

      Super.PostBeginPlay();
   }
}


Neither of these will die when they are spawned. If you remove XF_NOTMISSILE, they will.

The reason I'm reporting this is to determine if this is a legit bug or if a foil flag could be added to A_Explode to allow explicit damaging of same-species actors.

Re: A_Explode with XF_NOTMISSILE does not ignore DONTHARM* f

PostPosted: Mon Jun 15, 2020 3:57 pm
by phantombeta
This is caused by this code in RadiusAttack. It applies DONTHARMCLASS and DONTHARMSPECIES even when thing == bombsource, which is kinda nonsensical.
I don't think it's a good idea to just fix it now, though, since some mods might have abused this behaviour, be it on purpose or by accident. It's probably a better idea to add a flag to RadiusAttack and A_Explode to make it handle thing == bombsource correctly.