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
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]
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]
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]Script 1001 (void)
{
GiveInventory("ProjectileDestroyer",1);
}[/code]
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?