src/waypoint.cpp
branchnoai
changeset 9701 d1ac22c62f64
parent 9694 e72987579514
child 9718 f82a4facea8b
--- a/src/waypoint.cpp	Sun Aug 19 14:04:13 2007 +0000
+++ b/src/waypoint.cpp	Sun Sep 02 11:17:33 2007 +0000
@@ -196,6 +196,10 @@
 		wp->town_index = 0;
 		wp->string = STR_NULL;
 		wp->town_cn = 0;
+	} else if (flags & DC_EXEC) {
+		/* move existing (recently deleted) waypoint to the new location */
+		RedrawWaypointSign(wp);
+		wp->xy = tile;
 	}
 
 	if (flags & DC_EXEC) {
@@ -404,25 +408,16 @@
 
 Waypoint::~Waypoint()
 {
+	if (this->string != STR_NULL) DeleteName(this->string);
+
+	if (CleaningPool()) return;
+
 	RemoveOrderFromAllVehicles(OT_GOTO_WAYPOINT, this->index);
 
 	RedrawWaypointSign(this);
 	this->xy = 0;
-
-	this->QuickFree();
 }
 
-void Waypoint::QuickFree()
-{
-	if (this->string != STR_NULL) DeleteName(this->string);
-}
-
-bool Waypoint::IsValid() const
-{
-	return this->xy != 0;
-}
-
-
 /**
  * Fix savegames which stored waypoints in their old format
  */