(svn r1146) -Fix: You can no longer change waypoints whom are owned by somebody else
authortruelight
Fri, 17 Dec 2004 17:06:20 +0000
changeset 697 0406d50190f2
parent 696 d06270cd9727
child 698 edbf72dd127b
(svn r1146) -Fix: You can no longer change waypoints whom are owned by somebody else
main_gui.c
--- a/main_gui.c	Fri Dec 17 09:02:41 2004 +0000
+++ b/main_gui.c	Fri Dec 17 17:06:20 2004 +0000
@@ -376,6 +376,13 @@
 void ShowRenameWaypointWindow(Waypoint *cp)
 {
 	int id = cp - _waypoints;
+
+	/* Are we allowed to change the name of the waypoint? */
+	if (!CheckTileOwnership(cp->xy)) {
+		ShowErrorMessage(_error_message, STR_CANT_CHANGE_WAYPOINT_NAME, GET_TILE_X(cp->xy) * 16, GET_TILE_Y(cp->xy) * 16);
+		return;
+	}
+
 	_rename_id = id;
 	_rename_what = 1;
 	SetDParam(0, id);