(svn r13712) -Fix: enforce the length restrictions of company and president name in the commands too.
This commit is contained in:
@@ -225,7 +225,7 @@ static bool IsUniqueCompanyName(const char *name)
|
||||
*/
|
||||
CommandCost CmdChangeCompanyName(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||
{
|
||||
if (StrEmpty(_cmd_text)) return CMD_ERROR;
|
||||
if (StrEmpty(_cmd_text) || strlen(_cmd_text) > MAX_LENGTH_COMPANY_NAME) return CMD_ERROR;
|
||||
|
||||
if (!IsUniqueCompanyName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);
|
||||
|
||||
@@ -262,7 +262,7 @@ static bool IsUniquePresidentName(const char *name)
|
||||
*/
|
||||
CommandCost CmdChangePresidentName(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||
{
|
||||
if (StrEmpty(_cmd_text)) return CMD_ERROR;
|
||||
if (StrEmpty(_cmd_text) || strlen(_cmd_text) > MAX_LENGTH_PRESIDENT_NAME) return CMD_ERROR;
|
||||
|
||||
if (!IsUniquePresidentName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);
|
||||
|
||||
|
Reference in New Issue
Block a user