Merge branch 'master' into chatter-fixes-and-improvements
This commit is contained in:
commit
de38555aa1
11 changed files with 112 additions and 36 deletions
|
|
@ -917,7 +917,7 @@ void Bot::instantChatter (int type) {
|
|||
void Bot::pushRadioMessage (int message) {
|
||||
// this function inserts the radio message into the message queue
|
||||
|
||||
if (cv_radio_mode.as <int> () == 0 || m_numFriendsLeft == 0) {
|
||||
if (cv_radio_mode.as <int> () == 0 || m_numFriendsLeft == 0 || m_isCreature) {
|
||||
return;
|
||||
}
|
||||
m_forceRadio = !game.is (GameFlags::HasBotVoice)
|
||||
|
|
@ -931,7 +931,7 @@ void Bot::pushRadioMessage (int message) {
|
|||
void Bot::pushChatterMessage (int message) {
|
||||
// this function inserts the voice message into the message queue (mostly same as above)
|
||||
|
||||
if (!game.is (GameFlags::HasBotVoice) || cv_radio_mode.as <int> () != 2 || !conf.hasChatterBank (message) || m_numFriendsLeft == 0) {
|
||||
if (!game.is (GameFlags::HasBotVoice) || m_isCreature || cv_radio_mode.as <int> () != 2 || !conf.hasChatterBank (message) || m_numFriendsLeft == 0) {
|
||||
return;
|
||||
}
|
||||
bool sendMessage = false;
|
||||
|
|
@ -2345,7 +2345,7 @@ void Bot::checkRadioQueue () {
|
|||
|
||||
|
||||
// don't allow bot listen you if bot is busy
|
||||
if (m_radioOrder != Radio::ReportInTeam && (getCurrentTaskId () == Task::DefuseBomb || getCurrentTaskId () == Task::PlantBomb || m_hasHostage || m_hasC4)) {
|
||||
if (getCurrentTaskId () == Task::DefuseBomb || getCurrentTaskId () == Task::PlantBomb || m_hasHostage || m_hasC4 || m_isCreature) {
|
||||
m_radioOrder = 0;
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@ void Bot::checkForChat () {
|
|||
void Bot::sendToChat (StringRef message, bool teamOnly) {
|
||||
// this function prints saytext message to all players
|
||||
|
||||
if (message.empty () || !cv_chat) {
|
||||
if (m_isCreature || message.empty () || !cv_chat) {
|
||||
return;
|
||||
}
|
||||
issueCommand ("%s \"%s\"", teamOnly ? "say_team" : "say", message);
|
||||
|
|
|
|||
|
|
@ -678,6 +678,7 @@ void BotConfig::loadCustomConfig () {
|
|||
m_custom["ZMDetectCvar"] = "zp_delay";
|
||||
m_custom["ZMDelayCvar"] = "zp_delay";
|
||||
m_custom["ZMInfectedTeam"] = "T";
|
||||
m_custom["EnableFakeBotFeatures"] = "no";
|
||||
};
|
||||
|
||||
setDefaults ();
|
||||
|
|
|
|||
|
|
@ -72,6 +72,9 @@ void Game::levelInitialize (edict_t *entities, int max) {
|
|||
// execute main config
|
||||
conf.loadMainConfig ();
|
||||
|
||||
// ensure the server admin is confident about features he's using
|
||||
game.ensureHealthyGameEnvironment ();
|
||||
|
||||
// load map-specific config
|
||||
conf.loadMapSpecificConfig ();
|
||||
|
||||
|
|
@ -1010,6 +1013,9 @@ void Game::slowFrame () {
|
|||
// refresh bomb origin in case some plugin moved it out
|
||||
graph.setBombOrigin ();
|
||||
|
||||
// ensure the server admin is confident about features he's using
|
||||
game.ensureHealthyGameEnvironment ();
|
||||
|
||||
// update next update time
|
||||
m_halfSecondFrame = nextUpdate * 0.25f + time ();
|
||||
}
|
||||
|
|
@ -1150,6 +1156,48 @@ void Game::printBotVersion () {
|
|||
ctrl.msg ("\n%s v%s successfully loaded for game: Counter-Strike %s.\n\tFlags: %s.\n", product.name, product.version, gameVersionStr, botRuntimeFlags.empty () ? "None" : String::join (botRuntimeFlags, ", "));
|
||||
}
|
||||
|
||||
void Game::ensureHealthyGameEnvironment () {
|
||||
if (!isDedicated () || game.is (GameFlags::Legacy | GameFlags::Xash3D)) {
|
||||
return; // listen servers doesn't care about it at all
|
||||
}
|
||||
|
||||
// magic string that's enables the features
|
||||
constexpr auto kAllowHash = StringRef::fnv1a32 ("i'm confident for what i'm doing");
|
||||
|
||||
// fetch custom variable, so fake features are explicitly enabled
|
||||
static auto enableFakeFeatures = StringRef::fnv1a32 (conf.fetchCustom ("EnableFakeBotFeatures").chars ());
|
||||
|
||||
// if string matches, do not affect the cvars
|
||||
if (enableFakeFeatures == kAllowHash) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto notifyPeacefulRevert = [] (const ConVar &cv) {
|
||||
game.print ("Cvar \"%s\" reverted to peaceful value.", cv.name ());
|
||||
};
|
||||
|
||||
// disable fake latency
|
||||
if (cv_show_latency.as <int> () > 1) {
|
||||
cv_show_latency.set (0);
|
||||
|
||||
notifyPeacefulRevert (cv_show_latency);
|
||||
}
|
||||
|
||||
// disable fake avatars
|
||||
if (cv_show_avatars) {
|
||||
cv_show_avatars.set (0);
|
||||
|
||||
notifyPeacefulRevert (cv_show_avatars);
|
||||
}
|
||||
|
||||
// disable fake queries
|
||||
if (cv_enable_query_hook) {
|
||||
cv_enable_query_hook.set (0);
|
||||
|
||||
notifyPeacefulRevert (cv_enable_query_hook);
|
||||
}
|
||||
}
|
||||
|
||||
void LightMeasure::initializeLightstyles () {
|
||||
// this function initializes lighting information...
|
||||
|
||||
|
|
|
|||
|
|
@ -704,7 +704,7 @@ CR_LINKAGE_C int GetEngineFunctions (enginefuncs_t *table, int *) {
|
|||
// using pfnMessageBegin (), it will know what message ID number to send, and the engine will
|
||||
// know what to do, only for non-metamod version
|
||||
|
||||
return msgs.add (name, engfuncs.pfnRegUserMsg (name, size)); // return privously registered message
|
||||
return msgs.add (name, engfuncs.pfnRegUserMsg (name, size)); // return previously registered message
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,8 +31,9 @@ ConVar cv_difficulty_max ("difficulty_max", "-1", "Upper bound of random difficu
|
|||
ConVar cv_difficulty_auto ("difficulty_auto", "0", "Allows each bot to balance their own difficulty based kd-ratio of team.", true, 0.0f, 1.0f);
|
||||
ConVar cv_difficulty_auto_balance_interval ("difficulty_auto_balance_interval", "30", "Interval in which bots will balance their difficulty.", true, 30.0f, 240.0f);
|
||||
|
||||
ConVar cv_show_avatars ("show_avatars", "1", "Enables or disables displaying bot avatars in front of their names in scoreboard. Note, that is currently you can see only avatars of your steam friends.");
|
||||
ConVar cv_show_latency ("show_latency", "2", "Enables latency display in scoreboard.\nAllowed values: '0', '1', '2'.\nIf '0', there is nothing displayed.\nIf '1', there is a 'BOT' is displayed.\nIf '2' fake ping is displayed.", true, 0.0f, 2.0f);
|
||||
ConVar cv_show_avatars ("show_avatars", "0", "Enables or disables displaying bot avatars in front of their names in scoreboard. Note, that is currently you can see only avatars of your steam friends.");
|
||||
ConVar cv_show_latency ("show_latency", "0", "Enables latency display in scoreboard.\nAllowed values: '0', '1', '2'.\nIf '0', there is nothing displayed.\nIf '1', there is a 'BOT' is displayed.\nIf '2' fake ping is displayed.", true, 0.0f, 2.0f);
|
||||
|
||||
ConVar cv_save_bots_names ("save_bots_names", "1", "Allows to save bot names upon changelevel, so bot names will be the same after a map change.", true, 0.0f, 1.0f);
|
||||
|
||||
ConVar cv_botskin_t ("botskin_t", "0", "Specifies the bots wanted skin for Terrorist team.", true, 0.0f, 5.0f);
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ void BotSupport::checkWelcome () {
|
|||
" http://www.botepidemic.com/podbot for Updates\n";
|
||||
|
||||
// it's should be send in very rare cases
|
||||
const bool sendLegacyWelcome = rg.chance (2);
|
||||
const bool sendLegacyWelcome = rg.chance (game.is (GameFlags::Legacy) ? 25 : 2);
|
||||
|
||||
if (!graphAuthor.startsWith (product.name)) {
|
||||
authorStr.assignf ("Navigation Graph by: %s", graphAuthor);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue