- fixed the drain callback.

- changed the effect spawn prevention of the Hexen flame strike weapon and reverted the attempt to fix this in FastProjectile.

This cannot be fixed in the base class, which was doing everything right. It's the flame missile that was doing undefined things by stopping its movement without clearing its missile flag. This cannot work because missiles are given some minimal forced velocity to ensure collision detection and any attempt to address this without clearing the missile flag is doomed to fail.
This commit is contained in:
Christoph Oelckers 2017-03-29 22:50:13 +02:00
parent 3f9ad55432
commit 7011010ff2
3 changed files with 14 additions and 9 deletions

View File

@ -1415,15 +1415,19 @@ static int DamageMobj (AActor *target, AActor *inflictor, AActor *source, int da
}
}
IFVIRTUALPTR(source, AActor, OnDrain)
if (draindamage > 0)
{
VMValue params[] = { source, target, draindamage, mod.GetIndex() };
VMReturn ret(&draindamage);
GlobalVMStack.Call(func, params, countof(params), &ret, 1);
}
if ( P_GiveBody( source, int(draindamage * damage)))
{
S_Sound(source, CHAN_ITEM, "*drainhealth", 1, ATTN_NORM );
int draindmg = int(draindamage * damage);
IFVIRTUALPTR(source, AActor, OnDrain)
{
VMValue params[] = { source, target, draindmg, mod.GetIndex() };
VMReturn ret(&draindmg);
GlobalVMStack.Call(func, params, countof(params), &ret, 1);
}
if (P_GiveBody(source, draindmg))
{
S_Sound(source, CHAN_ITEM, "*drainhealth", 1, ATTN_NORM);
}
}
}
}

View File

@ -274,6 +274,7 @@ class CFlameMissile : FastProjectile
void A_CFlamePuff()
{
bInvisible = false;
bMissile = false;
Vel = (0,0,0);
A_PlaySound ("ClericFlameExplode", CHAN_BODY);
}

View File

@ -156,7 +156,7 @@ class FastProjectile : Actor
ExplodeMissile (NULL, NULL);
return;
}
if (!(frac.xy ~== (0, 0)) && ripcount <= 0)
if (changexy && ripcount <= 0)
{
ripcount = count >> 3;