mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-14 00:20:51 +00:00
- 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:
parent
3f9ad55432
commit
7011010ff2
3 changed files with 14 additions and 9 deletions
|
@ -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() };
|
int draindmg = int(draindamage * damage);
|
||||||
VMReturn ret(&draindamage);
|
IFVIRTUALPTR(source, AActor, OnDrain)
|
||||||
GlobalVMStack.Call(func, params, countof(params), &ret, 1);
|
{
|
||||||
}
|
VMValue params[] = { source, target, draindmg, mod.GetIndex() };
|
||||||
if ( P_GiveBody( source, int(draindamage * damage)))
|
VMReturn ret(&draindmg);
|
||||||
{
|
GlobalVMStack.Call(func, params, countof(params), &ret, 1);
|
||||||
S_Sound(source, CHAN_ITEM, "*drainhealth", 1, ATTN_NORM );
|
}
|
||||||
|
if (P_GiveBody(source, draindmg))
|
||||||
|
{
|
||||||
|
S_Sound(source, CHAN_ITEM, "*drainhealth", 1, ATTN_NORM);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue