mgr: fix leader selection stuff (fix #624)

Co-Authored-By: Max <161382234+dyspose@users.noreply.github.com>
This commit is contained in:
jeefo 2025-08-04 16:53:26 +03:00
commit cf9d0cc84f
No known key found for this signature in database
GPG key ID: D696786B81B667C8
2 changed files with 16 additions and 14 deletions

View file

@ -796,43 +796,45 @@ bool Game::loadCSBinary () {
return false; return false;
} }
Array <String> libs; Array <String> libs {};
// construct library suffix // construct library suffix
String lib_suffix; String libSuffix {};
if (plat.android) { if (plat.android) {
lib_suffix += "_android"; libSuffix += "_android";
} else if (plat.psvita) { } else if (plat.psvita) {
lib_suffix += "_psvita"; libSuffix += "_psvita";
} }
if (plat.x64) { if (plat.x64) {
if (plat.arm) { if (plat.arm) {
lib_suffix += "_arm64"; libSuffix += "_arm64";
} else if (plat.ppc) { } else if (plat.ppc) {
lib_suffix += "_ppc64le"; libSuffix += "_ppc64le";
} else { } else {
lib_suffix += "_amd64"; libSuffix += "_amd64";
} }
} else { } else {
if (plat.arm) { if (plat.arm) {
// don't want to put whole build.h logic from xash3d, just set whatever is supported by the YaPB // don't want to put whole build.h logic from xash3d, just set whatever is supported by the YaPB
if (plat.android) { if (plat.android) {
lib_suffix += "_armv7l"; libSuffix += "_armv7l";
} else { } else {
lib_suffix += "_armv7hf"; libSuffix += "_armv7hf";
} }
} else if (!plat.nix && !plat.win && !plat.macos) { } else if (!plat.nix && !plat.win && !plat.macos) {
lib_suffix += "_i386"; libSuffix += "_i386";
} }
} }
if (lib_suffix.empty ()) if (libSuffix.empty ())
libs.insert (0, { "mp", "cs", "cs_i386" }); libs.insert (0, { "mp", "cs", "cs_i386" });
else { else {
libs.insert (0, { "mp", "cs" }); libs.insert (0, { "mp", "cs" });
for (auto &lib: libs) { for (auto &lib: libs) {
lib += lib_suffix; lib += libSuffix;
} }
} }
@ -852,7 +854,7 @@ bool Game::loadCSBinary () {
// search the libraries inside game dlls directory // search the libraries inside game dlls directory
for (const auto &lib : libs) { for (const auto &lib : libs) {
String path; String path {};
if (plat.android) { if (plat.android) {
// this will be removed as soon as mod downloader will be implemented on engine side // this will be removed as soon as mod downloader will be implemented on engine side

View file

@ -464,7 +464,7 @@ void BotManager::maintainLeaders () {
} }
// select leader each team somewhere in round start // select leader each team somewhere in round start
if (m_timeRoundStart + 5.0f > game.time () && m_timeRoundStart + 10.0f < game.time ()) { if (m_timeRoundStart + rg (1.5f, 3.0f) < game.time ()) {
for (int team = 0; team < kGameTeamNum; ++team) { for (int team = 0; team < kGameTeamNum; ++team) {
selectLeaders (team, false); selectLeaders (team, false);
} }