fixed 'remove bot menu' not showing up

rewritten posix makefile from the ground
reworked menu logic, so endpoint menu item will redraw menu once again, instead of closing it.
This commit is contained in:
jeefo 2016-09-22 15:47:35 +03:00
commit 75d1f1ec58
7 changed files with 251 additions and 197 deletions

View file

@ -1712,7 +1712,7 @@ void Bot::PurchaseWeapons (void)
else // steam cs buy menu is different from old one
{
if (engine.GetTeam (GetEntity ()) == TERRORIST)
if (m_team == TERRORIST)
engine.IssueBotCommand (GetEntity (), "menuselect %d", selectedWeapon->newBuySelectT);
else
engine.IssueBotCommand (GetEntity (), "menuselect %d", selectedWeapon->newBuySelectCT);
@ -2929,7 +2929,7 @@ void Bot::ThinkFrame (void)
m_voteMap = 0;
}
}
else if (m_notKilled && m_buyingFinished && !(pev->maxspeed < 10.0f && GetTaskId () != TASK_PLANTBOMB && GetTaskId () != TASK_DEFUSEBOMB) && !yb_freeze_bots.GetBool ())
else if (m_notKilled && m_buyingFinished && !(pev->maxspeed < 10.0f && GetTaskId () != TASK_PLANTBOMB && GetTaskId () != TASK_DEFUSEBOMB) && !yb_freeze_bots.GetBool () && !waypoints.HasChanged ())
botMovement = true;
#ifdef XASH_CSDM
@ -2955,9 +2955,13 @@ void Bot::PeriodicThink (void)
m_numFriendsLeft = GetNearbyFriendsNearPosition (pev->origin, 99999.0f);
m_numEnemiesLeft = GetNearbyEnemiesNearPosition (pev->origin, 99999.0f);
if (g_bombPlanted && m_team == CT && (pev->origin - waypoints.GetBombPosition ()).GetLength () < 700 && !IsBombDefusing (waypoints.GetBombPosition ()) && !m_hasProgressBar && GetTaskId () != TASK_ESCAPEFROMBOMB)
ResetTasks ();
if (g_bombPlanted && m_team == CT)
{
const Vector &bombPosition = waypoints.GetBombPosition ();
if (!m_hasProgressBar && GetTaskId () != TASK_ESCAPEFROMBOMB && (pev->origin - bombPosition).GetLength () < 700 && !IsBombDefusing ())
ResetTasks ();
}
CheckSpawnTimeConditions ();
extern ConVar yb_chat;
@ -3559,10 +3563,10 @@ void Bot::RunTask_Camp (void)
dest.z = 0.0f;
// find a visible waypoint to this direction...
// i know this is ugly hack, but i just don't want to break compatiability :)
// i know this is ugly hack, but i just don't want to break compatibility :)
int numFoundPoints = 0;
int foundPoints[3];
int distanceTab[3];
int campPoints[3] = { 0, };
int distances[3] = { 0, };
const Vector &dotA = (dest - pev->origin).Normalize2D ();
@ -3574,7 +3578,7 @@ void Bot::RunTask_Camp (void)
const Vector &dotB = (waypoints.GetPath (i)->origin - pev->origin).Normalize2D ();
if ((dotA | dotB) > 0.9)
if ((dotA | dotB) > 0.9f)
{
int distance = static_cast <int> ((pev->origin - waypoints.GetPath (i)->origin).GetLength ());
@ -3582,10 +3586,10 @@ void Bot::RunTask_Camp (void)
{
for (int j = 0; j < 3; j++)
{
if (distance > distanceTab[j])
if (distance > distances[j])
{
distanceTab[j] = distance;
foundPoints[j] = i;
distances[j] = distance;
campPoints[j] = i;
break;
}
@ -3593,8 +3597,8 @@ void Bot::RunTask_Camp (void)
}
else
{
foundPoints[numFoundPoints] = i;
distanceTab[numFoundPoints] = distance;
campPoints[numFoundPoints] = i;
distances[numFoundPoints] = distance;
numFoundPoints++;
}
@ -3602,7 +3606,7 @@ void Bot::RunTask_Camp (void)
}
if (--numFoundPoints >= 0)
m_camp = waypoints.GetPath (foundPoints[Random.Int (0, numFoundPoints)])->origin;
m_camp = waypoints.GetPath (campPoints[Random.Int (0, numFoundPoints)])->origin;
else
m_camp = waypoints.GetPath (GetCampAimingWaypoint ())->origin;
}

View file

@ -157,25 +157,26 @@ WeaponSelect g_weaponSelect[NUM_WEAPONS + 1] =
{0, "", "", 0, 0, 0, 0, 0, 0, 0, 0, 0, false}
};
// bot menus
MenuText g_menus[BOT_MENU_TOTAL_MENUS] =
void SetupBotMenus (void)
{
// main menu
int counter = 0;
// bots main menu
g_menus[counter] =
{
BOT_MENU_MAIN,
0x2ff,
BOT_MENU_MAIN, 0x2ff,
"\\yMain Menu\\w\v\v"
"1. Control Bots\v"
"2. Features\v\v"
"3. Fill Server\v"
"4. End Round\v\v"
"0. Exit"
},
};
// bot features menu
// bots features menu
g_menus[++counter] =
{
BOT_MENU_FEATURES,
0x25f,
BOT_MENU_FEATURES, 0x25f,
"\\yBots Features\\w\v\v"
"1. Weapon Mode Menu\v"
"2. Waypoint Menu\v"
@ -183,12 +184,12 @@ MenuText g_menus[BOT_MENU_TOTAL_MENUS] =
"4. Toggle Debug Mode\v"
"5. Command Menu\v\v"
"0. Exit"
},
};
// bot control menu
g_menus[++counter] =
{
BOT_MENU_CONTROL,
0x2ff,
BOT_MENU_CONTROL, 0x2ff,
"\\yBots Control Menu\\w\v\v"
"1. Add a Bot, Quick\v"
"2. Add a Bot, Specified\v\v"
@ -196,12 +197,12 @@ MenuText g_menus[BOT_MENU_TOTAL_MENUS] =
"4. Remove All Bots\v\v"
"5. Remove Bot Menu\v\v"
"0. Exit"
},
};
// weapon mode select menu
g_menus[++counter] =
{
BOT_MENU_WEAPON_MODE,
0x27f,
BOT_MENU_WEAPON_MODE, 0x27f,
"\\yBots Weapon Mode\\w\v\v"
"1. Knives only\v"
"2. Pistols only\v"
@ -211,24 +212,24 @@ MenuText g_menus[BOT_MENU_TOTAL_MENUS] =
"6. Sniper Weapons only\v"
"7. All Weapons\v\v"
"0. Exit"
},
};
// personality select menu
g_menus[++counter] =
{
BOT_MENU_PERSONALITY,
0x20f,
BOT_MENU_PERSONALITY, 0x20f,
"\\yBots Personality\\w\v\v"
"1. Random\v"
"2. Normal\v"
"3. Aggressive\v"
"4. Careful\v\v"
"0. Exit"
},
};
// difficulty select menu
g_menus[++counter] =
{
BOT_MENU_DIFFICULTY,
0x23f,
BOT_MENU_DIFFICULTY, 0x23f,
"\\yBots Difficulty Level\\w\v\v"
"1. Newbie\v"
"2. Average\v"
@ -236,23 +237,23 @@ MenuText g_menus[BOT_MENU_TOTAL_MENUS] =
"4. Professional\v"
"5. Godlike\v\v"
"0. Exit"
},
};
// team select menu
g_menus[++counter] =
{
BOT_MENU_TEAM_SELECT,
0x213,
BOT_MENU_TEAM_SELECT, 0x213,
"\\ySelect a team\\w\v\v"
"1. Terrorist Force\v"
"2. Counter-Terrorist Force\v\v"
"5. Auto-select\v\v"
"0. Exit"
},
};
// terrorist model select menu
g_menus[++counter] =
{
BOT_MENU_TERRORIST_SELECT,
0x21f,
BOT_MENU_TERRORIST_SELECT, 0x21f,
"\\ySelect an appearance\\w\v\v"
"1. Phoenix Connexion\v"
"2. L337 Krew\v"
@ -260,12 +261,12 @@ MenuText g_menus[BOT_MENU_TOTAL_MENUS] =
"4. Guerilla Warfare\v\v"
"5. Auto-select\v\v"
"0. Exit"
},
};
// counter-terrorist model select menu
g_menus[++counter] =
{
BOT_MENU_CT_SELECT,
0x21f,
BOT_MENU_CT_SELECT, 0x21f,
"\\ySelect an appearance\\w\v\v"
"1. Seal Team 6 (DEVGRU)\v"
"2. German GSG-9\v"
@ -273,24 +274,24 @@ MenuText g_menus[BOT_MENU_TOTAL_MENUS] =
"4. French GIGN\v\v"
"5. Auto-select\v\v"
"0. Exit"
},
};
// command menu
g_menus[++counter] =
{
BOT_MENU_COMMANDS,
0x23f,
BOT_MENU_COMMANDS, 0x23f,
"\\yBot Command Menu\\w\v\v"
"1. Make Double Jump\v"
"2. Finish Double Jump\v\v"
"3. Drop the C4 Bomb\v"
"4. Drop the Weapon\v\v"
"0. Exit"
},
};
// main waypoint menu
g_menus[++counter] =
{
BOT_MENU_WAYPOINT_MAIN_PAGE1,
0x3ff,
BOT_MENU_WAYPOINT_MAIN_PAGE1, 0x3ff,
"\\yWaypoint Operations (Page 1)\\w\v\v"
"1. Show/Hide waypoints\v"
"2. Cache waypoint\v"
@ -302,12 +303,12 @@ MenuText g_menus[BOT_MENU_TOTAL_MENUS] =
"8. Set Radius\v\v"
"9. Next...\v\v"
"0. Exit"
},
};
// main waypoint menu (page 2)
g_menus[++counter] =
{
BOT_MENU_WAYPOINT_MAIN_PAGE2,
0x3ff,
BOT_MENU_WAYPOINT_MAIN_PAGE2, 0x3ff,
"\\yWaypoint Operations (Page 2)\\w\v\v"
"1. Waypoint stats\v"
"2. Autowaypoint on/off\v"
@ -319,12 +320,12 @@ MenuText g_menus[BOT_MENU_TOTAL_MENUS] =
"8. Noclip cheat on/off\v\v"
"9. Previous...\v\v"
"0. Exit"
},
};
// select waypoint radius menu
g_menus[++counter] =
{
BOT_MENU_WAYPOINT_RADIUS,
0x3ff,
BOT_MENU_WAYPOINT_RADIUS, 0x3ff,
"\\yWaypoint Radius\\w\v\v"
"1. SetRadius 0\v"
"2. SetRadius 8\v"
@ -336,12 +337,12 @@ MenuText g_menus[BOT_MENU_TOTAL_MENUS] =
"8. SetRadius 96\v"
"9. SetRadius 128\v\v"
"0. Exit"
},
};
// waypoint add menu
g_menus[++counter] =
{
BOT_MENU_WAYPOINT_TYPE,
0x3ff,
BOT_MENU_WAYPOINT_TYPE, 0x3ff,
"\\yWaypoint Type\\w\v\v"
"1. Normal\v"
"\\r2. Terrorist Important\v"
@ -353,12 +354,12 @@ MenuText g_menus[BOT_MENU_TOTAL_MENUS] =
"\\r8. Map Goal\v"
"\\w9. Jump\v\v"
"0. Exit"
},
};
// set waypoint flag menu
g_menus[++counter] =
{
BOT_MENU_WAYPOINT_FLAG,
0x2ff,
BOT_MENU_WAYPOINT_FLAG, 0x2ff,
"\\yToggle Waypoint Flags\\w\v\v"
"1. Block with Hostage\v"
"2. Terrorists Specific\v"
@ -366,9 +367,10 @@ MenuText g_menus[BOT_MENU_TOTAL_MENUS] =
"4. Use Elevator\v"
"5. Sniper Point (\\yFor Camp Points Only!\\w)\v\v"
"0. Exit"
},
};
// auto-path max distance
g_menus[++counter] =
{
BOT_MENU_WAYPOINT_AUTOPATH,
0x27f,
@ -381,9 +383,10 @@ MenuText g_menus[BOT_MENU_TOTAL_MENUS] =
"6. Distance 220\v"
"7. Distance 250 (Default)\v\v"
"0. Exit"
},
};
// path connections
g_menus[++counter] =
{
BOT_MENU_WAYPOINT_PATH,
0x207,
@ -392,33 +395,16 @@ MenuText g_menus[BOT_MENU_TOTAL_MENUS] =
"2. Incoming Path\v"
"3. Bidirectional (Both Ways)\v\v"
"0. Exit"
},
};
// kickmenu #1
{
BOT_MENU_KICK_PAGE_1,
0x0,
nullptr,
},
const String &empty = "";
// kickmenu #2
{
BOT_MENU_KICK_PAGE_2,
0x0,
nullptr,
},
// kick menus
g_menus[++counter] = { BOT_MENU_KICK_PAGE_1, 0x0, empty, };
g_menus[++counter] = { BOT_MENU_KICK_PAGE_2, 0x0, empty, };
g_menus[++counter] = { BOT_MENU_KICK_PAGE_3, 0x0, empty, };
g_menus[++counter] = { BOT_MENU_KICK_PAGE_4, 0x0, empty, };
}
// kickmenu #3
{
BOT_MENU_KICK_PAGE_3,
0x0,
nullptr,
},
// kickmenu #4
{
BOT_MENU_KICK_PAGE_4,
0x0,
nullptr,
}
};
// bot menus
MenuText g_menus[BOT_MENU_TOTAL_MENUS];

View file

@ -1236,14 +1236,20 @@ void ClientCommand (edict_t *ent)
case 6:
case 7:
waypoints.Add (selection - 1);
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_TYPE);
break;
case 8:
waypoints.Add (100);
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_TYPE);
break;
case 9:
waypoints.SetLearnJumpWaypoint ();
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_TYPE);
break;
case 10:
@ -1263,22 +1269,27 @@ void ClientCommand (edict_t *ent)
{
case 1:
waypoints.ToggleFlags (FLAG_NOHOSTAGE);
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_FLAG);
break;
case 2:
waypoints.ToggleFlags (FLAG_TF_ONLY);
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_FLAG);
break;
case 3:
waypoints.ToggleFlags (FLAG_CF_ONLY);
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_FLAG);
break;
case 4:
waypoints.ToggleFlags (FLAG_LIFT);
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_FLAG);
break;
case 5:
waypoints.ToggleFlags (FLAG_SNIPER);
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_FLAG);
break;
}
if (g_gameFlags & GAME_METAMOD)
@ -1297,11 +1308,15 @@ void ClientCommand (edict_t *ent)
engine.IssueCmd ("yapb waypoint off");
else
engine.IssueCmd ("yapb waypoint on");
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_MAIN_PAGE1);
break;
case 2:
g_waypointOn = true;
waypoints.CacheWaypoint ();
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_MAIN_PAGE1);
break;
case 3:
@ -1312,6 +1327,8 @@ void ClientCommand (edict_t *ent)
case 4:
g_waypointOn = true;
waypoints.DeletePath ();
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_MAIN_PAGE1);
break;
case 5:
@ -1322,6 +1339,8 @@ void ClientCommand (edict_t *ent)
case 6:
g_waypointOn = true;
waypoints.Delete ();
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_MAIN_PAGE1);
break;
case 7:
@ -1392,6 +1411,8 @@ void ClientCommand (edict_t *ent)
"CT Points: %d - Goal Points: %d\n"
"Rescue Points: %d - Camp Points: %d\n"
"Block Hostage Points: %d - Sniper Points: %d\n", g_numWaypoints, terrPoints, ctPoints, goalPoints, rescuePoints, campPoints, noHostagePoints, sniperPoints);
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_MAIN_PAGE2);
}
break;
@ -1401,6 +1422,8 @@ void ClientCommand (edict_t *ent)
g_autoWaypoint ^= 1;
engine.CenterPrintf ("Auto-Waypoint %s", g_autoWaypoint ? "Enabled" : "Disabled");
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_MAIN_PAGE2);
break;
case 3:
@ -1413,14 +1436,18 @@ void ClientCommand (edict_t *ent)
waypoints.Save ();
else
engine.CenterPrintf ("Waypoint not saved\nThere are errors, see console");
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_MAIN_PAGE2);
break;
case 5:
waypoints.Save ();
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_MAIN_PAGE2);
break;
case 6:
waypoints.Load ();
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_MAIN_PAGE2);
break;
case 7:
@ -1428,10 +1455,13 @@ void ClientCommand (edict_t *ent)
engine.CenterPrintf ("Nodes works fine");
else
engine.CenterPrintf ("There are errors, see console");
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_MAIN_PAGE2);
break;
case 8:
engine.IssueCmd ("yapb wp on noclip");
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_MAIN_PAGE2);
break;
case 9:
@ -1454,6 +1484,8 @@ void ClientCommand (edict_t *ent)
if ((selection >= 1) && (selection <= 9))
waypoints.SetRadius (radiusValue[selection - 1]);
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_RADIUS);
if (g_gameFlags & GAME_METAMOD)
RETURN_META (MRES_SUPERCEDE);
@ -1481,6 +1513,7 @@ void ClientCommand (edict_t *ent)
case 4:
bots.KillAll ();
DisplayMenuToClient (ent, BOT_MENU_MAIN);
break;
case 10:
@ -1501,6 +1534,7 @@ void ClientCommand (edict_t *ent)
{
case 1:
bots.AddRandom ();
DisplayMenuToClient (ent, BOT_MENU_CONTROL);
break;
case 2:
@ -1509,10 +1543,12 @@ void ClientCommand (edict_t *ent)
case 3:
bots.RemoveRandom ();
DisplayMenuToClient (ent, BOT_MENU_CONTROL);
break;
case 4:
bots.RemoveAll ();
DisplayMenuToClient (ent, BOT_MENU_CONTROL);
break;
case 5:
@ -1550,6 +1586,7 @@ void ClientCommand (edict_t *ent)
extern ConVar yb_debug;
yb_debug.SetInt (yb_debug.GetInt () ^ 1);
DisplayMenuToClient (ent, BOT_MENU_FEATURES);
break;
case 5:
@ -1596,16 +1633,17 @@ void ClientCommand (edict_t *ent)
}
else if (selection == 2)
bot->ResetDoubleJumpState ();
break;
}
}
DisplayMenuToClient (ent, BOT_MENU_COMMANDS);
break;
case 3:
case 4:
if (FindNearestPlayer (reinterpret_cast <void **> (&bot), ent, 300.0f, true, true, true))
bot->DiscardWeaponForUser (ent, selection == 4 ? false : true);
DisplayMenuToClient (ent, BOT_MENU_COMMANDS);
break;
case 10:
@ -1618,7 +1656,7 @@ void ClientCommand (edict_t *ent)
return;
}
else if (client->menu ==BOT_MENU_WAYPOINT_AUTOPATH)
else if (client->menu == BOT_MENU_WAYPOINT_AUTOPATH)
{
DisplayMenuToClient (ent, BOT_MENU_INVALID); // reset menu display
@ -1632,6 +1670,8 @@ void ClientCommand (edict_t *ent)
else
engine.CenterPrintf ("AutoPath maximum distance set to %.2f", g_autoPathDistance);
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_AUTOPATH);
if (g_gameFlags & GAME_METAMOD)
RETURN_META (MRES_SUPERCEDE);
@ -1645,14 +1685,17 @@ void ClientCommand (edict_t *ent)
{
case 1:
waypoints.CreatePath (CONNECTION_OUTGOING);
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_PATH);
break;
case 2:
waypoints.CreatePath (CONNECTION_INCOMING);
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_PATH);
break;
case 3:
waypoints.CreatePath (CONNECTION_BOTHWAYS);
DisplayMenuToClient (ent, BOT_MENU_WAYPOINT_PATH);
break;
case 10:
@ -1847,6 +1890,7 @@ void ClientCommand (edict_t *ent)
case 6:
case 7:
bots.SetWeaponMode (selection);
DisplayMenuToClient (ent, BOT_MENU_WEAPON_MODE);
break;
case 10:
@ -1873,6 +1917,7 @@ void ClientCommand (edict_t *ent)
case 7:
case 8:
bots.GetBot (selection - 1)->Kick ();
bots.RemoveMenu (ent, 1);
break;
case 9:
@ -1903,6 +1948,7 @@ void ClientCommand (edict_t *ent)
case 7:
case 8:
bots.GetBot (selection + 8 - 1)->Kick ();
bots.RemoveMenu (ent, 2);
break;
case 9:
@ -1933,6 +1979,7 @@ void ClientCommand (edict_t *ent)
case 7:
case 8:
bots.GetBot (selection + 16 - 1)->Kick ();
bots.RemoveMenu (ent, 3);
break;
case 9:
@ -1963,6 +2010,7 @@ void ClientCommand (edict_t *ent)
case 7:
case 8:
bots.GetBot (selection + 24 - 1)->Kick ();
bots.RemoveMenu (ent, 4);
break;
case 10:

View file

@ -572,12 +572,14 @@ void BotManager::RemoveMenu (edict_t *ent, int selection)
int validSlots = (selection == 4) ? (1 << 9) : ((1 << 8) | (1 << 9));
for (int i = ((selection - 1) * 8); i < selection * 8; i++)
for (int i = (selection - 1) * 8; i < selection * 8; i++)
{
if (m_bots[i] != nullptr && !engine.IsNullEntity (m_bots[i]->GetEntity ()))
const Bot *bot = GetBot (i);
if (bot != nullptr && (bot->pev->flags & FL_FAKECLIENT))
{
validSlots |= 1 << (i - ((selection - 1) * 8));
sprintf (buffer, "%s %1.1d. %s%s\n", buffer, i - ((selection - 1) * 8) + 1, STRING (m_bots[i]->pev->netname), engine.GetTeam (m_bots[i]->GetEntity ()) == CT ? " \\y(CT)\\w" : " \\r(T)\\w");
sprintf (buffer, "%s %1.1d. %s%s\n", buffer, i - ((selection - 1) * 8) + 1, STRING (bot->pev->netname), bot->m_team == CT ? " \\y(CT)\\w" : " \\r(T)\\w");
}
else
sprintf (buffer, "%s\\d %1.1d. Not a Bot\\w\n", buffer, i - ((selection - 1) * 8) + 1);
@ -585,32 +587,58 @@ void BotManager::RemoveMenu (edict_t *ent, int selection)
sprintf (tempBuffer, "\\yBots Remove Menu (%d/4):\\w\n\n%s\n%s 0. Back", selection, buffer, (selection == 4) ? "" : " 9. More...\n");
// force to clear current menu
DisplayMenuToClient (ent, BOT_MENU_INVALID);
auto FindMenu = [] (MenuId id)
{
int menuIndex = 0;
for (; menuIndex < ARRAYSIZE_HLSDK (g_menus); menuIndex++)
{
if (g_menus[menuIndex].id == id)
break;
}
return &g_menus[menuIndex];
};
MenuText *menu = nullptr;
const unsigned int slots = validSlots & static_cast <unsigned int> (-1);
switch (selection)
{
case 1:
g_menus[BOT_MENU_KICK_PAGE_1].slots = validSlots & static_cast <unsigned int> (-1);
g_menus[14].text = tempBuffer;
menu = FindMenu (BOT_MENU_KICK_PAGE_1);
menu->slots = slots;
menu->text = tempBuffer;
DisplayMenuToClient (ent, BOT_MENU_KICK_PAGE_1);
break;
case 2:
g_menus[BOT_MENU_KICK_PAGE_2].slots = validSlots & static_cast <unsigned int> (-1);
g_menus[BOT_MENU_KICK_PAGE_2].text = tempBuffer;
menu = FindMenu (BOT_MENU_KICK_PAGE_2);
menu->slots = slots;
menu->text = tempBuffer;
DisplayMenuToClient (ent, BOT_MENU_KICK_PAGE_2);
break;
case 3:
g_menus[BOT_MENU_KICK_PAGE_3].slots = validSlots & static_cast <unsigned int> (-1);
g_menus[BOT_MENU_KICK_PAGE_3].text = tempBuffer;
menu = FindMenu (BOT_MENU_KICK_PAGE_3);
menu->slots = slots;
menu->text = tempBuffer;
DisplayMenuToClient (ent, BOT_MENU_KICK_PAGE_3);
break;
case 4:
g_menus[BOT_MENU_KICK_PAGE_4].slots = validSlots & static_cast <unsigned int> (-1);
g_menus[BOT_MENU_KICK_PAGE_4].text = tempBuffer;
menu = FindMenu (BOT_MENU_KICK_PAGE_4);
menu->slots = slots;
menu->text = tempBuffer;
DisplayMenuToClient (ent, BOT_MENU_KICK_PAGE_4);
break;
@ -1265,6 +1293,9 @@ void Bot::Kick (bool keepQuota)
{
// this function kick off one bot from the server.
// clear fakeclient bit immediately
pev->flags &= ~FL_FAKECLIENT;
engine.IssueCmd ("kick \"%s\"", STRING (pev->netname));
engine.CenterPrintf ("Bot '%s' kicked", STRING (pev->netname));

View file

@ -106,6 +106,9 @@ void DisplayMenuToClient (edict_t *ent, MenuId menu)
// make menus looks like we need only once
if (!s_menusParsed)
{
extern void SetupBotMenus (void);
SetupBotMenus ();
for (int i = 0; i < ARRAYSIZE_HLSDK (g_menus); i++)
{
auto parsed = &g_menus[i];