summaryrefslogtreecommitdiff
path: root/src/waypoint.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-06-27 23:40:21 +0000
committerpeter1138 <peter1138@openttd.org>2007-06-27 23:40:21 +0000
commit86f2f51c737d0d68e8a0b99166bb06a203f9aacc (patch)
treeb27637970e643fe182ba0668d2fdfdc379934bc3 /src/waypoint.cpp
parent4720ff0de30de4b9a61c01ce2001ff3a834e2c39 (diff)
downloadopenttd-86f2f51c737d0d68e8a0b99166bb06a203f9aacc.tar.xz
(svn r10368) -Fix: when renaming waypoints, ownership was only checked client-side, not in the command.
Diffstat (limited to 'src/waypoint.cpp')
-rw-r--r--src/waypoint.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/waypoint.cpp b/src/waypoint.cpp
index 6b81cff41..d2980b3d9 100644
--- a/src/waypoint.cpp
+++ b/src/waypoint.cpp
@@ -371,6 +371,9 @@ CommandCost CmdRenameWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2
if (!IsValidWaypointID(p1)) return CMD_ERROR;
+ wp = GetWaypoint(p1);
+ if (!CheckTileOwnership(wp->xy)) return CMD_ERROR;
+
if (!StrEmpty(_cmd_text)) {
if (!IsUniqueWaypointName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);
@@ -379,7 +382,6 @@ CommandCost CmdRenameWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2
if (str == 0) return CMD_ERROR;
if (flags & DC_EXEC) {
- wp = GetWaypoint(p1);
if (wp->string != STR_NULL) DeleteName(wp->string);
wp->string = str;
@@ -392,7 +394,6 @@ CommandCost CmdRenameWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2
}
} else {
if (flags & DC_EXEC) {
- wp = GetWaypoint(p1);
if (wp->string != STR_NULL) DeleteName(wp->string);
MakeDefaultWaypointName(wp);