add: do not translate messages send to hlds console.

add: split messages sent to client & hlds console, so all message gets sent.
This commit is contained in:
ds 2020-10-12 20:59:48 +03:00
commit b8d35840b3
9 changed files with 143 additions and 59 deletions

View file

@ -199,11 +199,22 @@ public:
// global heloer for sending message to correct channel
template <typename ...Args> inline void BotControl::msg (const char *fmt, Args &&...args) {
const bool isDedicated = game.isDedicated () && game.isNullEntity (m_ent);
// disable translation if we're sending to server console
if (isDedicated) {
conf.enableTranslation (false);
}
auto result = strings.format (conf.translate (fmt), cr::forward <Args> (args)...);
// if no receiver or many message have to appear, just print to server console
if (game.isNullEntity (m_ent) || m_rapidOutput) {
game.print (result);
game.print (result); // print the info
// enable translation aftetwards
if (isDedicated) {
conf.enableTranslation (true);
}
return;
}