Allow the Ynykron to suck in inventory (but not destroy it).

Fix suckable actors self-cleaning.
This commit is contained in:
Mari the Deer 2021-03-19 22:15:10 +01:00
commit 0501f876d3
3 changed files with 9 additions and 4 deletions

View file

@ -197,7 +197,7 @@ extend Class SWWMHandler
override void WorldThingDestroyed( WorldEvent e )
{
if ( !e.Thing.default.bSHOOTABLE || !e.Thing.default.bMISSILE )
if ( !e.Thing.default.bSHOOTABLE && !e.Thing.default.bMISSILE && !(e Thing is 'Inventory') )
return;
// remove from suckables
int pos = suckableactors.Find(e.Thing);
@ -343,7 +343,7 @@ extend Class SWWMHandler
SWWMShadow.Track(e.Thing);
}
// Ynykron vortex optimization (faster than a thinker iterator)
if ( e.Thing.bSHOOTABLE || e.Thing.bMISSILE )
if ( e.Thing.bSHOOTABLE || e.Thing.bMISSILE || (e.Thing is 'Inventory') )
SuckableActors.Push(e.Thing);
// vanilla blood color changes
if ( (e.Thing.GetClass() == "BaronOfHell") || (e.Thing.GetClass() == "HellKnight") || (e.Thing.GetClass() == "Bishop") || (e.Thing.GetClass() == "Korax") )

View file

@ -2302,6 +2302,8 @@ Class YnykronSingularity : Actor
if ( !a ) continue;
if ( a.bDORMANT || (a.Health <= 0) || (a == self) || !SWWMUtility.SphereIntersect(a,pos,20000.*scale.x) || !CheckSight(a,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) )
continue;
if ( (a is 'Inventory') && !a.bSPECIAL ) // must be a pickup
continue;
if ( a.player && (a.player.cheats&CF_NOCLIP2) ) // for safety
continue;
double capmass = a.mass;
@ -2316,6 +2318,9 @@ Class YnykronSingularity : Actor
a.Destroy();
continue;
}
// don't delet inventory
if ( a is 'Inventory' )
continue;
// delet missile
if ( a.bMISSILE )
{