diff options
Diffstat (limited to 'src/signs_cmd.cpp')
-rw-r--r-- | src/signs_cmd.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/signs_cmd.cpp b/src/signs_cmd.cpp index a44ca2241..cb8add163 100644 --- a/src/signs_cmd.cpp +++ b/src/signs_cmd.cpp @@ -66,15 +66,14 @@ CommandCost CmdPlaceSign(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 */ CommandCost CmdRenameSign(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) { - if (!Sign::IsValidID(p1)) return CMD_ERROR; + Sign *si = Sign::GetIfValid(p1); + if (si == NULL) return CMD_ERROR; /* Rename the signs when empty, otherwise remove it */ if (!StrEmpty(text)) { if (strlen(text) >= MAX_LENGTH_SIGN_NAME_BYTES) return CMD_ERROR; if (flags & DC_EXEC) { - Sign *si = Sign::Get(p1); - /* Delete the old name */ free(si->name); /* Assign the new one */ @@ -89,8 +88,6 @@ CommandCost CmdRenameSign(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 } } else { // Delete sign if (flags & DC_EXEC) { - Sign *si = Sign::Get(p1); - MarkSignDirty(si); delete si; |