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!
Accensus
Posts: 2383
Joined: Thu Feb 11, 2016 9:59 am

A_Explode with XF_NOTMISSILE does not ignore DONTHARM* flags

Post 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 all

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
phantombeta
Posts: 2084
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: A_Explode with XF_NOTMISSILE does not ignore DONTHARM* f

Post 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.
Post Reply

Return to “Bugs [GZDoom]”