(svn r14322) -Fix (r10368): possible assert when renaming removed waypoint
authorsmatz
Sun, 14 Sep 2008 15:48:49 +0000
changeset 10136 5d822fc9a3b8
parent 10135 21b4050a479b
child 10137 189e1e91fe82
(svn r14322) -Fix (r10368): possible assert when renaming removed waypoint
src/waypoint.cpp
--- a/src/waypoint.cpp	Sun Sep 14 14:31:37 2008 +0000
+++ b/src/waypoint.cpp	Sun Sep 14 15:48:49 2008 +0000
@@ -381,12 +381,10 @@
  */
 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;