From c940c2ba81802e162065c76f9e6452a03b96d7ed Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 8 Feb 2016 13:34:54 +0100 Subject: [PATCH] - fixed: The counters for the whirlwind were initialized too late, the first time they are needed is in P_CheckMissileSpawn, which gets called from inside P_SpawnMissile. Also took the opportunity and moved them to properties that are accessible from DECORATE. --- src/g_heretic/a_ironlich.cpp | 6 ++---- src/p_mobj.cpp | 2 +- src/p_saveg.cpp | 2 +- src/thingdef/thingdef_properties.cpp | 15 +++++++++++++-- wadsrc/static/actors/actor.txt | 2 +- wadsrc/static/actors/heretic/ironlich.txt | 2 ++ 6 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/g_heretic/a_ironlich.cpp b/src/g_heretic/a_ironlich.cpp index 7262db2e5..45a5640d2 100644 --- a/src/g_heretic/a_ironlich.cpp +++ b/src/g_heretic/a_ironlich.cpp @@ -131,8 +131,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichAttack) { mo->AddZ(-32*FRACUNIT, false); mo->tracer = target; - mo->special1 = 60; - mo->special2 = 50; // Timer for active sound mo->health = 20*TICRATE; // Duration S_Sound (self, CHAN_BODY, "ironlich/attack3", 1, ATTN_NORM); } @@ -158,9 +156,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_WhirlwindSeek) self->flags &= ~MF_MISSILE; return 0; } - if ((self->special2 -= 3) < 0) + if ((self->threshold -= 3) < 0) { - self->special2 = 58 + (pr_seek() & 31); + self->threshold = 58 + (pr_seek() & 31); S_Sound (self, CHAN_BODY, "ironlich/attack3", 1, ATTN_NORM); } if (self->tracer && self->tracer->flags&MF_SHADOW) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index d47460038..a7573f4dc 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -1353,7 +1353,7 @@ void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target) { if (mo->flags3 & MF3_EXPLOCOUNT) { - if (++mo->special2 < mo->special1) + if (++mo->threshold < mo->DefThreshold) { return; } diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index cf2be64e8..f0aedd5c6 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -516,7 +516,7 @@ void P_SerializeWorld (FArchive &arc) arc << zn->Environment; } - if (SaveVersion >= 4533) + if (SaveVersion >= 4532) { arc << linePortals; } diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index 5b9874a35..cecdfb172 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -547,14 +547,25 @@ DEFINE_PROPERTY(painthreshold, I, Actor) //========================================================================== // //========================================================================== -DEFINE_PROPERTY(chasethreshold, I, Actor) +DEFINE_PROPERTY(defthreshold, I, Actor) { PROP_INT_PARM(id, 0); if (id < 0) - I_Error("ChaseThreshold cannot be negative."); + I_Error("DefThreshold cannot be negative."); defaults->DefThreshold = id; } +//========================================================================== +// +//========================================================================== +DEFINE_PROPERTY(threshold, I, Actor) +{ + PROP_INT_PARM(id, 0); + if (id < 0) + I_Error("Threshold cannot be negative."); + defaults->threshold = id; +} + //========================================================================== // //========================================================================== diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index 869d9dd2e..31153f2ea 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -31,7 +31,7 @@ ACTOR Actor native //: Thinker RipperLevel 0 RipLevelMin 0 RipLevelMax 0 - ChaseThreshold 100 + DefThreshold 100 // Functions native bool CheckClass(class checkclass, int ptr_select = AAPTR_DEFAULT, bool match_superclass = false); diff --git a/wadsrc/static/actors/heretic/ironlich.txt b/wadsrc/static/actors/heretic/ironlich.txt index 4b3527a4f..35bd3f9b8 100644 --- a/wadsrc/static/actors/heretic/ironlich.txt +++ b/wadsrc/static/actors/heretic/ironlich.txt @@ -154,6 +154,8 @@ ACTOR Whirlwind native +EXPLOCOUNT +StepMissile RenderStyle Translucent + DefThreshold 60 + Threshold 50 Alpha 0.4 action native A_WhirlwindSeek();