NSEntity: Fix SetNextThink doing occasional bogus fixups

This commit is contained in:
Marco Cawthorne 2023-03-13 15:25:37 -07:00
parent 7709c579c3
commit 719f85210d
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
1 changed files with 5 additions and 5 deletions

View File

@ -502,16 +502,16 @@ void NSEntity::SetThink( void ( void ) func ) {
}
void NSEntity::SetNextThink( float fl ) {
float flTime = GetTime();
float flTime = GetTime() + fl;
/* HACK: to make sure things happen post-spawn */
if ( flTime <= 0.0f )
if ( flTime == 0.0f )
flTime = 0.1f;
if ( fl >= 0 )
nextthink = flTime + fl;
if ( flTime >= 0 )
nextthink = flTime;
else
NSLog( "%s sets bogus nextthink value %f\n", classname, fl );
NSLog( "%s sets bogus nextthink value %f\n", classname, flTime );
}
void NSEntity::ScheduleThink( void ( void ) func, float fl ) {