Mikoportal compatibility for voodoo dolls.

Includes VM abort fix for KDiKDiZD (though both mods are incompatible).
This commit is contained in:
Mari the Deer 2022-11-20 20:30:45 +01:00
commit 7a1e7a41a4
3 changed files with 34 additions and 2 deletions

View file

@ -261,6 +261,27 @@ extend Class SWWMHandler
// while we're at it
Actor.Spawn("RampancyLogonDummy");
}
// KDiKDiZD abort fix due to voodoo doll post-spawn replacement
// (we have our own mikoportal compatibility, anyway)
//
// note that the mods are mutually incompatible nonetheless
// since KDiKDiZD requires software rendering, while this is a
// hardware-only mod... but hey, they can sort-of-work together
// (with broken visual effects, but still... somewhat working)
for ( int i=0; i<AllClasses.Size(); i++ )
{
if ( AllClasses[i].GetClassName() != 'KdikdizdCompatEventHandler' )
continue;
ti = ThinkerIterator.Create("Thinker");
Thinker t;
while ( t = ti.Next() )
{
if ( t.GetClassName() != 'VoodooPusher' )
continue;
t.Destroy();
}
break;
}
// setup cached lockdefs data
let cli = SWWMCachedLockInfo.GetInstance();
if ( cli.ent.Size() == 0 ) SetupLockdefsCache(cli);

View file

@ -3950,11 +3950,22 @@ Class Demolitionist : PlayerPawn
Class SWWMVoodooDoll : PlayerPawn
{
Vector3 lastvel;
override String GetObituary( Actor victim, Actor inflictor, Name mod, bool playerattack )
{
// as simple as it gets
return "$OB_VOODOO";
}
override void Tick()
{
Super.Tick();
// mikoportal compat
if ( !(pos.z ~== -32768) ) return;
if ( vel.length() <= lastvel.length() )
vel = lastvel;
lastvel = vel;
}
Default
{
Tag "$FN_VOODOO";