improve: use ScoreAttrib message to detect if bot is a VIP or not. (#356)

This should resolve problems with bot behavior, when plugins changes VIP player model to something else.
This commit is contained in:
jeefo 2022-08-03 23:59:57 +03:00 committed by GitHub
commit b606b78cda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 11 deletions

View file

@ -3001,10 +3001,6 @@ void Bot::update () {
m_team = game.getTeam (ent ());
m_healthValue = cr::clamp (pev->health, 0.0f, 100.0f);
if (game.mapIs (MapFlags::Assassination) && !m_isVIP) {
m_isVIP = util.isPlayerVIP (ent ());
}
if (m_team == Team::Terrorist && game.mapIs (MapFlags::Demolition)) {
m_hasC4 = !!(pev->weapons & cr::bit (Weapon::C4));