Using m_RunLabel instead of trying to get the game script everytime

This commit is contained in:
smallmodel 2023-08-19 20:49:20 +02:00
parent af056d7646
commit 2e4759ab1f
No known key found for this signature in database
GPG key ID: A96F163ED4891440
2 changed files with 5 additions and 5 deletions

View file

@ -85,6 +85,7 @@ PlayerBot::PlayerBot()
m_iAttackTime = 0;
m_StateFlags = 0;
m_RunLabel.TrySetScript("global/bot_run.scr");
}
void PlayerBot::Init
@ -326,13 +327,11 @@ void PlayerBot::MoveThink
m_botCmd.rightmove = ( signed char )( y > 127 ? 127 : y < -127 ? -127 : y );
CheckJump();
Event params;
Weapon *pWeap = GetActiveWeapon( WEAPON_MAIN );
if( pWeap && !pWeap->ShouldReload() )
{
ExecuteThread( "global/bot_run.scr", "", params );
m_RunLabel.Execute(this);
}
}

View file

@ -83,8 +83,9 @@ private:
float m_fYawSpeedMult;
// States
int m_StateCount;
unsigned int m_StateFlags;
int m_StateCount;
unsigned int m_StateFlags;
ScriptThreadLabel m_RunLabel;
private:
void CheckAttractiveNodes( void );