fix: weapon firing with pistols after last commit
This commit is contained in:
parent
71b9f4efc8
commit
8770569e1f
2 changed files with 11 additions and 9 deletions
|
|
@ -737,6 +737,7 @@ public:
|
|||
|
||||
public:
|
||||
void logic (); /// the things that can be executed while skipping frames
|
||||
void upkeep ();
|
||||
void spawned ();
|
||||
void takeBlind (int alpha);
|
||||
void takeDamage (edict_t *inflictor, int damage, int armor, int bits);
|
||||
|
|
|
|||
|
|
@ -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 ();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue