graph: move light level calculation to thread worker

fix: nodes with light level 0.0 should trigger bots flashlight now
fix: gcc and msvc builds due to mistake in crlib
refactor: add more const-correctness (ongoing)
This commit is contained in:
jeefo 2023-06-24 03:23:22 +03:00
commit 3d2579c7ea
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
11 changed files with 121 additions and 111 deletions

View file

@ -1745,7 +1745,7 @@ bool BotControl::executeCommands () {
if (prefix != product.cmdPri && prefix != product.cmdSec) {
return false;
}
auto &client = util.getClient (game.indexOfPlayer (m_ent));
const auto &client = util.getClient (game.indexOfPlayer (m_ent));
// do not allow to execute stuff for non admins
if (m_ent != game.getLocalEntity () && !(client.flags & ClientFlags::Admin)) {
@ -1853,7 +1853,7 @@ bool BotControl::executeMenus () {
if (!util.isPlayer (m_ent) || game.isBotCmd ()) {
return false;
}
auto &issuer = util.getClient (game.indexOfPlayer (m_ent));
const auto &issuer = util.getClient (game.indexOfPlayer (m_ent));
// check if it's menu select, and some key pressed
if (strValue (0) != "menuselect" || strValue (1).empty () || issuer.menu == Menu::None) {