From 719f85210d327bb677a8f2c5ab5eb8486210d2ce Mon Sep 17 00:00:00 2001 From: Marco Cawthorne Date: Mon, 13 Mar 2023 15:25:37 -0700 Subject: [PATCH] NSEntity: Fix SetNextThink doing occasional bogus fixups --- src/shared/NSEntity.qc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/shared/NSEntity.qc b/src/shared/NSEntity.qc index b124af87..b6fb226d 100644 --- a/src/shared/NSEntity.qc +++ b/src/shared/NSEntity.qc @@ -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 ) {