Suppose I have a mutator that uses function MutatorTakeDamage to spawn various effects...
Decided it needed a way to limit the number of effects being spawned based on time.
Have come up with 2 methods that both will work.
SpawnRate is a config var in the ini.
Here is the first:
(the log and else if (!bDoSpawn) log lines will be out of the prod. version...)
Code: Select all
function Timer()
{
bDoSpawn = True;
log("Timer time: "@Level.TimeSeconds);
}
.
.
.
if ((ActualDamage > 0) && (bDoSpawn))
{
... Do my stuff
SetTimer(SpawnRate, True);
bDoSpawn = False;
}
else if (!bDoSpawn) log("Spawn skipped by timer....");
doing a check on Level.TimeSeconds within the MutatorTakeDamage function.
Which method is going to execute faster ?