bot: reduce items ignorance after donating bomb

refactor: fix some typos
This commit is contained in:
jeefo 2024-05-22 19:57:02 +03:00
commit 5b63690986
No known key found for this signature in database
GPG key ID: D696786B81B667C8
2 changed files with 7 additions and 8 deletions

View file

@ -4140,9 +4140,8 @@ bool Bot::isCreature () {
return m_isOnInfectedTeam || m_modelMask == kModelMaskZombie || m_modelMask == kModelMaskChicken; return m_isOnInfectedTeam || m_modelMask == kModelMaskZombie || m_modelMask == kModelMaskChicken;
} }
void Bot::donateC4ToHuman () { void Bot::donateC4ToHuman () {
edict_t *recepient = nullptr; edict_t *recipient = nullptr;
if (!m_hasC4) { if (!m_hasC4) {
return; return;
@ -4155,15 +4154,15 @@ void Bot::donateC4ToHuman () {
} }
if (client.origin.distanceSq (pev->origin) < radiusSq) { if (client.origin.distanceSq (pev->origin) < radiusSq) {
recepient = client.ent; recipient = client.ent;
break; break;
} }
} }
if (game.isNullEntity (recepient)) { if (game.isNullEntity (recipient)) {
return; return;
} }
m_itemCheckTime = game.time () + 2.0f; m_itemCheckTime = game.time () + 1.0f;
// select the bomb // select the bomb
if (m_currentWeapon != Weapon::C4) { if (m_currentWeapon != Weapon::C4) {
@ -4190,8 +4189,8 @@ void Bot::donateC4ToHuman () {
if (!game.isNullEntity (bomb)) { if (!game.isNullEntity (bomb)) {
bomb->v.flags |= FL_ONGROUND; bomb->v.flags |= FL_ONGROUND;
// make recepient frient "pickup" it // make recipient friend "pickup" ищьи
MDLL_Touch (bomb, recepient); MDLL_Touch (bomb, recipient);
} }
} }

View file

@ -90,7 +90,7 @@ void Game::levelInitialize (edict_t *entities, int max) {
// set the global timer function // set the global timer function
timerStorage.setTimeAddress (&globals->time); timerStorage.setTimeAddress (&globals->time);
// reset timer // restart the fakeping timer, so it'll start working after mapchange
fakeping.restartTimer (); fakeping.restartTimer ();
// go thru the all entities on map, and do whatever we're want // go thru the all entities on map, and do whatever we're want