RGF_MISSILES and NOBLOCKMAP interference

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 a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: RGF_MISSILES and NOBLOCKMAP interference

Re: RGF_MISSILES and NOBLOCKMAP interference

by Major Cooke » Mon Nov 10, 2014 4:58 pm

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.

Re: RGF_MISSILES and NOBLOCKMAP interference

by Gez » Mon Nov 10, 2014 5:49 am

You found out why something like RGF_MISSILE wasn't present in the original submission.

Re: RGF_MISSILES and NOBLOCKMAP interference

by Graf Zahl » Sun Nov 09, 2014 3:04 pm

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.

RGF_MISSILES and NOBLOCKMAP interference

by Major Cooke » Sun Nov 09, 2014 2:37 pm

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

Top