Use std::string for CommandContainer text instead of giant static buffer

Use move semantics for CommandContainer instance where feasible
This commit is contained in:
Jonathan G Rennison
2018-08-13 12:16:41 +01:00
parent 957cff34dc
commit 940314a3c7
10 changed files with 90 additions and 42 deletions

View File

@@ -15,6 +15,7 @@
#include "economy_type.h"
#include "strings_type.h"
#include "tile_type.h"
#include <string>
struct GRFFile;
@@ -550,7 +551,7 @@ struct CommandContainer {
uint32 cmd; ///< command being executed.
CommandCallback *callback; ///< any callback function executed upon successful completion of the command.
uint32 binary_length; ///< in case text contains binary data, this describes its length.
char text[MAX_CMD_TEXT_LENGTH]; ///< possible text sent for name changes etc, in bytes including '\0'.
std::string text; ///< possible text sent for name changes etc.
};
#endif /* COMMAND_TYPE_H */