RGF_MISSILES and NOBLOCKMAP interference

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Major Cooke
Posts: 8215
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

RGF_MISSILES and NOBLOCKMAP interference

Post by Major Cooke »

Alright, I've become a little stumped by this problem. Now I need some help.

Download the test.pk3 and start up the game. In console:
summon deflectorbox

Move back a little, then:
summon testmissile

Move back some more and watch. The moment NoBlockMap is disabled a second later, THEN it is eligible to receiving the ProjectileDestroyer custom inventory.

Okay, that makes sense. What doesn't make sense, most likely, is my attempt to perform the same change in A_RadiusGive... Which didn't even work by the way, nothing changed.

Code: Select all

	AActor *thing;
	bool isMissile = false;
	bool noBlockMap = false;
	while ((thing = it.Next()))
	{

		//...

		else if (thing->flags & MF_MISSILE)
		{
			if (!(flags & RGF_MISSILES))
			{
				continue;
			}
			isMissile = true;
			if (thing->flags & MF_NOBLOCKMAP)
			{
				noBlockMap = true;
			}
		}

		//...

		if ((flags & RGF_NOSIGHT) || P_CheckSight (thing, self, SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY))
		{ // OK to give; target is in direct path, or the monster doesn't care about it being in line of sight.

			//Code slightly copied from A_ChangeFlag.
			if ((isMissile) && (noBlockMap))
			{
				thing->UnlinkFromWorld();
				thing->flags &= ~MF_NOBLOCKMAP;
				thing->LinkToWorld();
			}

			AInventory *gift = static_cast<AInventory *>(Spawn (item, 0, 0, 0, NO_REPLACE));
			if (gift->IsKindOf(RUNTIME_CLASS(AHealth)))
			{
				gift->Amount *= amount;
			}
			else
			{
				gift->Amount = amount;
			}
			gift->flags |= MF_DROPPED;
			gift->ClearCounters();
			if (!gift->CallTryPickup (thing))
			{
				gift->Destroy ();
			}
			//[MC]
			//Attempt to restore it.
			if ((isMissile) && (noBlockMap))
			{
				thing->UnlinkFromWorld();
				thing->flags |= MF_NOBLOCKMAP;
				thing->LinkToWorld();
			}
		}
Which strikes me as odd, because when using a DECORATE actor that has ThingSpec_MissileTriggers | ThingSpec_TriggerActs | ThingSpec_NoDeathSpecial which calls ACS_ExecuteAlways on this script:

Code: Select all

Script 1001 (void)
{
	GiveInventory("ProjectileDestroyer",1);
}
This works, but to a limited degree. So, in short, the feature of RGF_MISSILES is still slightly broken, I've tried to fix it, but I'm kinda out of options. Any ideas/suggestions on what to do with A_RadiusGive?
Attachments
test.pk3
(805 Bytes) Downloaded 29 times
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: RGF_MISSILES and NOBLOCKMAP interference

Post by Graf Zahl »

Changing the NOBLOCKMAP status in there cannot have an effect because no action that depends on the blockmap is being performed between unsetting and resetting it.

Since the actor is not in the blockmap to begin with, the iterator has no chance of ever finding it in the first place.

And sorry, this is not fixable, if you need to do any outside manipulation on a projectile you have to clear its NOBLOCKMAP flag, it can't possibly work otherwise.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: RGF_MISSILES and NOBLOCKMAP interference

Post by Gez »

You found out why something like RGF_MISSILE wasn't present in the original submission.
User avatar
Major Cooke
Posts: 8215
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: RGF_MISSILES and NOBLOCKMAP interference

Post by Major Cooke »

Either I don't recall properly why, or I never had my question answered until now. Oh well. :P

I can still do some interesting things with it regardless.
Post Reply

Return to “Closed Bugs [GZDoom]”