A_Explode with XF_NOTMISSILE does not ignore DONTHARM* flags

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

A_Explode with XF_NOTMISSILE does not ignore DONTHARM* flags

Postby Accensus » Mon Jun 15, 2020 3:47 pm

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.
User avatar
Accensus
Vector, locked in.
 
Joined: 11 Feb 2016
Location: Somalia
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: A_Explode with XF_NOTMISSILE does not ignore DONTHARM* f

Postby phantombeta » Mon Jun 15, 2020 3:57 pm

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.
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
 
Joined: 02 May 2013
Location: Brazil, South America, Earth, Orion-Cygnus Arm, Milky Way
Discord: phantombeta#2461
Twitch ID: phantombeta_
Github ID: Doom2fan
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support


Return to Bugs

Who is online

Users browsing this forum: No registered users and 3 guests