fix: bots can't plant bomb on multi-scenario maps (fix #537)

This commit is contained in:
jeefo 2024-03-19 23:38:48 +03:00
commit c03d8ac790
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
3 changed files with 462 additions and 460 deletions

2
.gitattributes vendored
View file

@ -1,5 +1,5 @@
# Auto detect text files and perform LF normalization
* text=auto
* text=lf
# Custom for Visual Studio
*.sln merge=union

View file

@ -182,7 +182,7 @@ void Bot::normal_ () {
m_hostages.clear ();
}
}
else if (m_team == Team::Terrorist && rg.chance (75)) {
else if (m_team == Team::Terrorist && rg.chance (75) && !game.mapIs (MapFlags::Demolition)) {
const int index = findDefendNode (m_path->origin);
startTask (Task::Camp, TaskPri::Camp, kInvalidNodeIndex, game.time () + rg.get (60.0f, 120.0f), true); // push camp task on to stack
@ -193,7 +193,9 @@ void Bot::normal_ () {
pushChatterMessage (Chatter::GoingToGuardVIPSafety); // play info about that
}
}
else if (game.mapIs (MapFlags::Demolition) && ((m_pathFlags & NodeFlag::Goal) && m_inBombZone)) {
// was elseif here but brokes csde_ scenario
if (game.mapIs (MapFlags::Demolition) && (m_pathFlags & NodeFlag::Goal) && m_inBombZone) {
// is it a terrorist carrying the bomb?
if (m_hasC4) {
if ((m_states & Sense::SeeingEnemy) && numFriendsNear (pev->origin, 768.0f) == 0) {