- added a FloatBobPhase property for DECORATE. Now, if FloatBobPhase is anything but -1 it will be used directly as the initial phase, allowing to define actors that bob in sync. The allowed range of phases is 0 - 63. The main reason for this is that each actor spawn called the pr_spawnmobj RNG just to randomize this value which causes problems with non-interactive actors, in particular GZDoom's dynamic lights.

SVN r4296 (trunk)
This commit is contained in:
Christoph Oelckers 2013-05-30 08:52:29 +00:00
parent 0eb72156ed
commit a7c2346b32
3 changed files with 12 additions and 1 deletions

View file

@ -3879,7 +3879,7 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t
actor->SpawnPoint[2] = (actor->z - actor->floorz);
}
actor->FloatBobPhase = rng(); // Don't make everything bob in sync
if (actor->FloatBobPhase < 0) actor->FloatBobPhase = rng(); // Don't make everything bob in sync (unless deliberately told to do)
if (actor->flags2 & MF2_FLOORCLIP)
{
actor->AdjustFloorClip ();

View file

@ -624,6 +624,16 @@ DEFINE_PROPERTY(scale, F, Actor)
defaults->scaleX = defaults->scaleY = id;
}
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(floatbobphase, F, Actor)
{
PROP_FIXED_PARM(id, 0);
if (id < -1 || id >= 64) I_Error ("FloatBobPhase must be in range [-1,63]");
defaults->FloatBobPhase = id;
}
//==========================================================================
//
//==========================================================================

View file

@ -16,6 +16,7 @@ ACTOR Actor native //: Thinker
WallBounceFactor 0.75
BounceCount -1
FloatSpeed 4
FloatBobPhase -1 // randomly initialize by default
Gravity 1
DamageFactor 1.0
PushFactor 0.25