- 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.

This commit is contained in:
Christoph Oelckers 2016-02-08 13:34:54 +01:00
parent 43b4d452db
commit c940c2ba81
6 changed files with 20 additions and 9 deletions

View File

@ -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)

View File

@ -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;
}

View File

@ -516,7 +516,7 @@ void P_SerializeWorld (FArchive &arc)
arc << zn->Environment;
}
if (SaveVersion >= 4533)
if (SaveVersion >= 4532)
{
arc << linePortals;
}

View File

@ -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;
}
//==========================================================================
//
//==========================================================================

View File

@ -31,7 +31,7 @@ ACTOR Actor native //: Thinker
RipperLevel 0
RipLevelMin 0
RipLevelMax 0
ChaseThreshold 100
DefThreshold 100
// Functions
native bool CheckClass(class<Actor> checkclass, int ptr_select = AAPTR_DEFAULT, bool match_superclass = false);

View File

@ -154,6 +154,8 @@ ACTOR Whirlwind native
+EXPLOCOUNT
+StepMissile
RenderStyle Translucent
DefThreshold 60
Threshold 50
Alpha 0.4
action native A_WhirlwindSeek();