misc: cosmetic changes
This commit is contained in:
parent
eadd7cd3a2
commit
c65272e65b
6 changed files with 8 additions and 6 deletions
|
|
@ -47,6 +47,8 @@ public:
|
|||
const StringRef dtime { __DATE__ " " __TIME__ };
|
||||
const StringRef date { __DATE__ };
|
||||
const StringRef version { MODULE_BOT_VERSION };
|
||||
const StringRef cmdPri { "yb" };
|
||||
const StringRef cmdSec { "yapb" };
|
||||
};
|
||||
|
||||
// expose product info
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ void BotConfig::loadMainConfig () {
|
|||
MemFile file;
|
||||
|
||||
// this is does the same as exec of engine, but not overwriting values of cvars spcified in cv_ignore_cvars_on_changelevel
|
||||
if (util.openConfig ("yapb.cfg", "YaPB main config file is not found.", &file, false)) {
|
||||
if (util.openConfig (strings.format ("%s.cfg", product.folder), "Bot main config file is not found.", &file, false)) {
|
||||
while (file.getLine (line)) {
|
||||
line.trim ();
|
||||
|
||||
|
|
|
|||
|
|
@ -1549,7 +1549,7 @@ bool BotControl::executeCommands () {
|
|||
const auto &prefix = m_args[0];
|
||||
|
||||
// no handling if not for us
|
||||
if (prefix != "yb" && prefix != "yapb") {
|
||||
if (prefix != product.cmdPri && prefix != product.cmdSec) {
|
||||
return false;
|
||||
}
|
||||
Client &client = util.getClient (game.indexOfPlayer (m_ent));
|
||||
|
|
|
|||
|
|
@ -747,7 +747,7 @@ bool Game::postload () {
|
|||
game.registerCvars ();
|
||||
|
||||
// handle prefixes
|
||||
static StringArray prefixes = { "yb", "yapb" };
|
||||
static StringArray prefixes = { product.cmdPri, product.cmdSec };
|
||||
|
||||
// register all our handlers
|
||||
for (const auto &prefix : prefixes) {
|
||||
|
|
|
|||
|
|
@ -1832,11 +1832,11 @@ bool BotGraph::saveGraphData () {
|
|||
author = m_editor->v.netname.chars ();
|
||||
}
|
||||
else {
|
||||
author = "YAPB";
|
||||
author = product.name;
|
||||
}
|
||||
|
||||
// mark as official
|
||||
if (author.startsWith ("YAPB")) {
|
||||
if (author.startsWith (product.name)) {
|
||||
options |= StorageOption::Official;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ BotCreateResult BotManager::create (StringRef name, int difficulty, int personal
|
|||
resultName = botName->name;
|
||||
}
|
||||
else {
|
||||
resultName.assignf ("yapb_%d.%d", rg.int_ (100, 10000), rg.int_ (100, 10000)); // just pick ugly random name
|
||||
resultName.assignf ("%s_%d.%d", product.folder, rg.int_ (100, 10000), rg.int_ (100, 10000)); // just pick ugly random name
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue