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

View file

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

View file

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