From 7011010ff255b7dec821cc57f1c6e9df8dc4e596 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 29 Mar 2017 22:50:13 +0200 Subject: [PATCH] - 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. --- src/p_interaction.cpp | 20 +++++++++++-------- wadsrc/static/zscript/hexen/clericflame.txt | 1 + .../static/zscript/shared/fastprojectile.txt | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 431c637de..b4db7cb0b 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -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); + } } } } diff --git a/wadsrc/static/zscript/hexen/clericflame.txt b/wadsrc/static/zscript/hexen/clericflame.txt index d222a07db..1978f43f1 100644 --- a/wadsrc/static/zscript/hexen/clericflame.txt +++ b/wadsrc/static/zscript/hexen/clericflame.txt @@ -274,6 +274,7 @@ class CFlameMissile : FastProjectile void A_CFlamePuff() { bInvisible = false; + bMissile = false; Vel = (0,0,0); A_PlaySound ("ClericFlameExplode", CHAN_BODY); } diff --git a/wadsrc/static/zscript/shared/fastprojectile.txt b/wadsrc/static/zscript/shared/fastprojectile.txt index 657c4680e..a0fa1a91c 100644 --- a/wadsrc/static/zscript/shared/fastprojectile.txt +++ b/wadsrc/static/zscript/shared/fastprojectile.txt @@ -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;