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:
|
public:
|
||||||
void logic (); /// the things that can be executed while skipping frames
|
void logic (); /// the things that can be executed while skipping frames
|
||||||
|
void upkeep ();
|
||||||
void spawned ();
|
void spawned ();
|
||||||
void takeBlind (int alpha);
|
void takeBlind (int alpha);
|
||||||
void takeDamage (edict_t *inflictor, int damage, int armor, int bits);
|
void takeDamage (edict_t *inflictor, int damage, int armor, int bits);
|
||||||
|
|
|
||||||
|
|
@ -3010,13 +3010,7 @@ void Bot::frame () {
|
||||||
if (m_thinkTimer.time < game.time ()) {
|
if (m_thinkTimer.time < game.time ()) {
|
||||||
m_thinkTimer.time = game.time () + m_thinkTimer.interval;
|
m_thinkTimer.time = game.time () + m_thinkTimer.interval;
|
||||||
|
|
||||||
if (m_aimFlags & AimFlags::Enemy) {
|
upkeep ();
|
||||||
focusEnemy ();
|
|
||||||
}
|
|
||||||
doFireWeapons ();
|
|
||||||
updateLookAngles ();
|
|
||||||
|
|
||||||
pev->flags |= FL_CLIENT | FL_FAKECLIENT; // restore fake client bit, just in case
|
|
||||||
|
|
||||||
if (m_fullThinkTimer.time < game.time ()) {
|
if (m_fullThinkTimer.time < game.time ()) {
|
||||||
m_fullThinkTimer.time = game.time () + m_fullThinkTimer.interval;
|
m_fullThinkTimer.time = game.time () + m_fullThinkTimer.interval;
|
||||||
|
|
@ -3090,6 +3084,7 @@ void Bot::update () {
|
||||||
if (m_lastDamageTimestamp < game.time () && !cr::fzero (m_lastDamageTimestamp)) {
|
if (m_lastDamageTimestamp < game.time () && !cr::fzero (m_lastDamageTimestamp)) {
|
||||||
m_lastDamageTimestamp = 0.0f;
|
m_lastDamageTimestamp = 0.0f;
|
||||||
}
|
}
|
||||||
|
pev->flags |= FL_CLIENT | FL_FAKECLIENT; // restore fake client bit, just in case
|
||||||
|
|
||||||
// is bot movement enabled
|
// is bot movement enabled
|
||||||
m_botMovement = false;
|
m_botMovement = false;
|
||||||
|
|
@ -3391,8 +3386,6 @@ void Bot::logic () {
|
||||||
|
|
||||||
executeTasks (); // execute current task
|
executeTasks (); // execute current task
|
||||||
setAimDirection (); // choose aim direction
|
setAimDirection (); // choose aim direction
|
||||||
updateLookAngles (); // and turn to chosen aim direction
|
|
||||||
doFireWeapons (); // do weapon firing
|
|
||||||
|
|
||||||
// check for reloading
|
// check for reloading
|
||||||
if (m_reloadCheckTime <= game.time ()) {
|
if (m_reloadCheckTime <= game.time ()) {
|
||||||
|
|
@ -3475,6 +3468,14 @@ void Bot::logic () {
|
||||||
m_lastDamageType = -1; // reset damage
|
m_lastDamageType = -1; // reset damage
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Bot::upkeep () {
|
||||||
|
if (m_aimFlags & AimFlags::Enemy) {
|
||||||
|
focusEnemy ();
|
||||||
|
}
|
||||||
|
doFireWeapons ();
|
||||||
|
updateLookAngles ();
|
||||||
|
}
|
||||||
|
|
||||||
void Bot::spawned () {
|
void Bot::spawned () {
|
||||||
if (game.is (GameFlags::CSDM | GameFlags::ZombieMod)) {
|
if (game.is (GameFlags::CSDM | GameFlags::ZombieMod)) {
|
||||||
newRound ();
|
newRound ();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue