Use a fallback for when the player name is not known in debug notifications
We just found out that it is possible for the player name to not be set when loading a singleplayer start-of-scenario save for the first time right after launching Wesnoth. It's best to have an actual $player value for that case instead of spurting 100% syntactically invalid statements like "The :lua command was used during 's turn" because of the empty variable.
This commit is contained in:
parent
81cfb11af0
commit
8b41d4d8fc
1 changed files with 4 additions and 0 deletions
|
@ -399,6 +399,10 @@ namespace
|
|||
std::string message;
|
||||
utils::string_map i18n_vars = {{ "player", current_team.current_player() }};
|
||||
|
||||
if(i18n_vars["player"].empty()) {
|
||||
i18n_vars["player"] = _("(unknown player)");
|
||||
}
|
||||
|
||||
if(message_is_command) {
|
||||
i18n_vars["command"] = text;
|
||||
message = VGETTEXT("The :$command debug command was used during $player’s turn", i18n_vars);
|
||||
|
|
Loading…
Add table
Reference in a new issue