From 2327359d74c7a5af518f64287903c0c62bdf2039 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 23 Dec 2016 10:09:10 +0200 Subject: [PATCH 1/2] Fixed sector floor offset compatibility parameter after floatification See https://forum.zdoom.org/viewtopic.php?t=54690 --- src/compatibility.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/compatibility.cpp b/src/compatibility.cpp index 60f9d8ad6..742f43eee 100644 --- a/src/compatibility.cpp +++ b/src/compatibility.cpp @@ -533,8 +533,9 @@ void SetCompatibilityParams() if (CompatParams[i+1] < numsectors) { sector_t *sec = §ors[CompatParams[i+1]]; - sec->floorplane.ChangeHeight(CompatParams[i+2]); - sec->ChangePlaneTexZ(sector_t::floor, CompatParams[i+2] / 65536.); + const double delta = CompatParams[i + 2] / 65536.0; + sec->floorplane.ChangeHeight(delta); + sec->ChangePlaneTexZ(sector_t::floor, delta); } i += 3; break; From 4fcf9933f0f6bdcd110510afab3a0d4173c474f8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 23 Dec 2016 16:33:05 +0100 Subject: [PATCH 2/2] - copy target to a local variable in A_VileAttack so that it remains accessible if A_Explode destroys the actor. --- wadsrc/static/zscript/doom/archvile.txt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/wadsrc/static/zscript/doom/archvile.txt b/wadsrc/static/zscript/doom/archvile.txt index 9faa80495..a19e5c705 100644 --- a/wadsrc/static/zscript/doom/archvile.txt +++ b/wadsrc/static/zscript/doom/archvile.txt @@ -125,25 +125,26 @@ extend class Actor void A_VileAttack(sound snd = "vile/stop", int initialdmg = 20, int blastdmg = 70, int blastradius = 70, double thrust = 1.0, name damagetype = "Fire", int flags = 0) { - if (target) + Actor targ = target; + if (targ) { A_FaceTarget(); - if (!CheckSight(target, 0)) return; + if (!CheckSight(targ, 0)) return; A_PlaySound(snd, CHAN_WEAPON); - int newdam = target.DamageMobj (self, self, initialdmg, (flags & VAF_DMGTYPEAPPLYTODIRECT)? damagetype : 'none'); + int newdam = targ.DamageMobj (self, self, initialdmg, (flags & VAF_DMGTYPEAPPLYTODIRECT)? damagetype : 'none'); - TraceBleed (newdam > 0 ? newdam : initialdmg, target); + TraceBleed (newdam > 0 ? newdam : initialdmg, targ); Actor fire = tracer; if (fire) { // move the fire between the vile and the player - fire.SetOrigin(target.Vec3Angle(-24., angle, 0), true); + fire.SetOrigin(targ.Vec3Angle(-24., angle, 0), true); fire.A_Explode(blastdmg, blastradius, XF_NOSPLASH, false, 0, 0, 0, "BulletPuff", damagetype); } - if (!target.bDontThrust) + if (!targ.bDontThrust) { - target.Vel.z = thrust * 1000 / max(1, target.Mass); + targ.Vel.z = thrust * 1000 / max(1, targ.Mass); } } }