Fix #13760: Store encoded error message inside CommandCost. (#13764)

Encoded error message was previously static to avoid memmory allocation, however this causes complications.
This commit is contained in:
Peter Nelson
2025-03-15 20:09:11 +00:00
committed by GitHub
parent 0cd87bc8c1
commit a87b804386
5 changed files with 9 additions and 12 deletions

View File

@@ -87,7 +87,7 @@ protected:
static void InternalDoBefore(bool top_level, bool test);
static void InternalDoAfter(CommandCost &res, DoCommandFlags flags, bool top_level, bool test);
static std::tuple<bool, bool, bool> InternalPostBefore(Commands cmd, CommandFlags flags, TileIndex tile, StringID err_message, bool network_command);
static void InternalPostResult(const CommandCost &res, TileIndex tile, bool estimate_only, bool only_sending, StringID err_message, bool my_cmd);
static void InternalPostResult(CommandCost &res, TileIndex tile, bool estimate_only, bool only_sending, StringID err_message, bool my_cmd);
static bool InternalExecutePrepTest(CommandFlags cmd_flags, TileIndex tile, Backup<CompanyID> &cur_company);
static std::tuple<bool, bool, bool> InternalExecuteValidateTestAndPrepExec(CommandCost &res, CommandFlags cmd_flags, bool estimate_only, bool network_command, Backup<CompanyID> &cur_company);
static CommandCost InternalExecuteProcessResult(Commands cmd, CommandFlags cmd_flags, const CommandCost &res_test, const CommandCost &res_exec, Money extra_cash, TileIndex tile, Backup<CompanyID> &cur_company);