- Added a function to get the actor's age in ticks.

This commit is contained in:
Player701 2018-11-04 20:55:52 +03:00 committed by Christoph Oelckers
commit 56f76a141e
3 changed files with 21 additions and 0 deletions

View file

@ -8085,6 +8085,24 @@ DEFINE_ACTION_FUNCTION(AActor, GetLevelSpawnTime)
ACTION_RETURN_INT(self->GetLevelSpawnTime());
}
//==========================================================================
//
// AActor :: GetAge
//
// Returns the number of ticks passed since this actor was spawned.
//
//==========================================================================
int AActor::GetAge() const
{
return level.totaltime - SpawnTime;
}
DEFINE_ACTION_FUNCTION(AActor, GetAge)
{
PARAM_SELF_PROLOGUE(AActor);
ACTION_RETURN_INT(self->GetAge());
}
//---------------------------------------------------------------------------
//
// PROP A_RestoreSpecialPosition