1
0
Fork 0

(svn r14322) -Fix (r10368): possible assert when renaming removed waypoint

release/0.7
smatz 2008-09-14 15:48:49 +00:00
parent 6ce4fe40f7
commit c5960b4be1
1 changed files with 2 additions and 4 deletions

View File

@ -381,12 +381,10 @@ static bool IsUniqueWaypointName(const char *name)
*/
CommandCost CmdRenameWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
Waypoint *wp;
if (!IsValidWaypointID(p1)) return CMD_ERROR;
wp = GetWaypoint(p1);
if (!CheckTileOwnership(wp->xy)) return CMD_ERROR;
Waypoint *wp = GetWaypoint(p1);
if (!CheckOwnership(wp->owner)) return CMD_ERROR;
if (!StrEmpty(_cmd_text)) {
if (strlen(_cmd_text) >= MAX_LENGTH_WAYPOINT_NAME_BYTES) return CMD_ERROR;