(svn r7519) -Fix: [YAPF] Cache was not deleted when waypoint was built or removed (frosch)
authorKUDr
Wed, 20 Dec 2006 23:41:24 +0000
changeset 5348 0f05b1348b5a
parent 5347 18836f961808
child 5349 6a220d58c0ce
(svn r7519) -Fix: [YAPF] Cache was not deleted when waypoint was built or removed (frosch)
waypoint.c
--- a/waypoint.c	Wed Dec 20 21:17:33 2006 +0000
+++ b/waypoint.c	Wed Dec 20 23:41:24 2006 +0000
@@ -244,6 +244,7 @@
 
 		UpdateWaypointSign(wp);
 		RedrawWaypointSign(wp);
+		YapfNotifyTrackLayoutChange(tile, AxisToTrack(axis));
 	}
 
 	return _price.build_train_depot;
@@ -274,6 +275,7 @@
 	}
 
 	if (flags & DC_EXEC) {
+		Track track = GetRailWaypointTrack(tile);
 		wp = GetWaypointByTile(tile);
 
 		wp->deleted = 30; // let it live for this many days before we do the actual deletion.
@@ -284,9 +286,9 @@
 			MarkTileDirtyByTile(tile);
 		} else {
 			DoClearSquare(tile);
-			SetSignalsOnBothDir(tile, GetRailWaypointTrack(tile));
-			YapfNotifyTrackLayoutChange(tile, GetRailWaypointTrack(tile));
+			SetSignalsOnBothDir(tile, track);
 		}
+		YapfNotifyTrackLayoutChange(tile, track);
 	}
 
 	return _price.remove_train_depot;