fix: weapon firing with pistols after last commit

This commit is contained in:
jeefo 2025-08-23 16:50:32 +03:00
commit 8770569e1f
No known key found for this signature in database
GPG key ID: D696786B81B667C8
2 changed files with 11 additions and 9 deletions

View file

@ -3010,13 +3010,7 @@ void Bot::frame () {
if (m_thinkTimer.time < game.time ()) {
m_thinkTimer.time = game.time () + m_thinkTimer.interval;
if (m_aimFlags & AimFlags::Enemy) {
focusEnemy ();
}
doFireWeapons ();
updateLookAngles ();
pev->flags |= FL_CLIENT | FL_FAKECLIENT; // restore fake client bit, just in case
upkeep ();
if (m_fullThinkTimer.time < game.time ()) {
m_fullThinkTimer.time = game.time () + m_fullThinkTimer.interval;
@ -3090,6 +3084,7 @@ void Bot::update () {
if (m_lastDamageTimestamp < game.time () && !cr::fzero (m_lastDamageTimestamp)) {
m_lastDamageTimestamp = 0.0f;
}
pev->flags |= FL_CLIENT | FL_FAKECLIENT; // restore fake client bit, just in case
// is bot movement enabled
m_botMovement = false;
@ -3391,8 +3386,6 @@ void Bot::logic () {
executeTasks (); // execute current task
setAimDirection (); // choose aim direction
updateLookAngles (); // and turn to chosen aim direction
doFireWeapons (); // do weapon firing
// check for reloading
if (m_reloadCheckTime <= game.time ()) {
@ -3475,6 +3468,14 @@ void Bot::logic () {
m_lastDamageType = -1; // reset damage
}
void Bot::upkeep () {
if (m_aimFlags & AimFlags::Enemy) {
focusEnemy ();
}
doFireWeapons ();
updateLookAngles ();
}
void Bot::spawned () {
if (game.is (GameFlags::CSDM | GameFlags::ZombieMod)) {
newRound ();