fix: crash when enabling hitbox aiming between rounds
This commit is contained in:
parent
1684da81cd
commit
40dc667e03
3 changed files with 9 additions and 4 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit 0a75fd3ec1118db9a3867b9a6210a2cd070ae3c3
|
||||
Subproject commit 01a2628642b5d28c42d115bbe99167756376839c
|
||||
|
|
@ -1562,8 +1562,13 @@ void Bot::newRound () {
|
|||
m_hostages.clear ();
|
||||
|
||||
if (cv_use_hitbox_enemy_targeting) {
|
||||
if (m_hitboxEnumerator) {
|
||||
m_hitboxEnumerator->reset ();
|
||||
}
|
||||
else {
|
||||
m_hitboxEnumerator = cr::makeUnique <PlayerHitboxEnumerator> ();
|
||||
}
|
||||
}
|
||||
|
||||
m_approachingLadderTimer.invalidate ();
|
||||
m_forgetLastVictimTimer.invalidate ();
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ bool BotSupport::isAlive (edict_t *ent) {
|
|||
if (game.isNullEntity (ent)) {
|
||||
return false;
|
||||
}
|
||||
return ent->v.deadflag == DEAD_NO && ent->v.health > 0 && ent->v.movetype != MOVETYPE_NOCLIP;
|
||||
return ent->v.deadflag == DEAD_NO && ent->v.health > 0.0f && ent->v.movetype != MOVETYPE_NOCLIP;
|
||||
}
|
||||
|
||||
bool BotSupport::isVisible (const Vector &origin, edict_t *ent) {
|
||||
|
|
@ -382,7 +382,7 @@ void BotSupport::updateClients () {
|
|||
client.ent = player;
|
||||
client.flags |= ClientFlags::Used;
|
||||
|
||||
if (util.isAlive (player)) {
|
||||
if (isAlive (player)) {
|
||||
client.flags |= ClientFlags::Alive;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue