fix: bots at difficulty 0 unable to do anything useful

fix: lang configs unable to parse last translated line (fixes #340)
fix: last enemy isn't  cleared instantly with dead entity anymore
fix: bot weakness in pistol rounds
analyzer: improved optimization of useless nodes
linkage: make inability to call gamedll player( non-fatal
linkage: fixed bot boot  on WON engines pre 2000 builds (support for beta 6.5 restored)
cvars: added suupport to revert all cvars to defaults via 'yb cvars defaults'
cvars: added cv_preferred_personality  to select bot default personality
refactor: use single function to send hud messages over the bot code
bot: added random original podbot welcome message to preserve origins of this bot
conf: shuffle bot names and chatter items on conflig load
conf: simplified a bit chatter.cfg syntax (old syntax  still works
build: added support for building with CMake (thanks @Velaron)
refactor: rall the memory hooks moved into their one cpp file
This commit is contained in:
jeefo 2024-01-19 00:03:45 +03:00
commit bf91ef2831
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
35 changed files with 1256 additions and 734 deletions

View file

@ -195,7 +195,29 @@ int BotControl::cmdList () {
int BotControl::cmdCvars () {
enum args { alias = 1, pattern };
const auto &match = strValue (pattern);
auto match = strValue (pattern);
// revert all the cvars to their default values
if (match == "defaults") {
msg ("Bots cvars has been reverted to their default values.");
for (const auto &cvar : game.getCvars ()) {
if (!cvar.self || !cvar.self->ptr || cvar.type == Var::GameRef) {
continue;
}
// set depending on cvar type
if (cvar.bounded) {
cvar.self->set (cvar.initial);
}
else {
cvar.self->set (cvar.init.chars ());
}
}
cv_quota.revert (); // quota should be reverted instead of regval
return BotCommandResult::Handled;
}
const bool isSaveMain = match == "save";
const bool isSaveMap = match == "save_map";
@ -2162,11 +2184,9 @@ bool BotControl::handleMenuCommands (edict_t *ent) {
}
void BotControl::enableDrawModels (bool enable) {
StringArray entities;
entities.push ("info_player_start");
entities.push ("info_player_deathmatch");
entities.push ("info_vip_start");
static StringArray entities {
"info_player_start", "info_player_deathmatch", "info_vip_start"
};
if (enable) {
game.setPlayerStartDrawModels ();