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();
}
}Code: Select all
Script 1001 (void)
{
GiveInventory("ProjectileDestroyer",1);
}