Changeset - r7704:e8f790cab905
[Not reviewed]
master
0 1 0
rubidium - 17 years ago 2007-10-09 21:29:34
rubidium@openttd.org
(svn r11238) -Fix [FS#1316]: the orders of trains going to a waypoint where not updated when the waypoint would be moved.
1 file changed with 14 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/waypoint.cpp
Show inline comments
 
@@ -197,7 +197,20 @@ CommandCost CmdBuildTrainWaypoint(TileIn
 
		wp->string = STR_NULL;
 
		wp->town_cn = 0;
 
	} else if (flags & DC_EXEC) {
 
		/* move existing (recently deleted) waypoint to the new location */
 
		/* Move existing (recently deleted) waypoint to the new location */
 

	
 
		/* First we update the destination for all vehicles that
 
		 * have the old waypoint in their orders. */
 
		Vehicle *v;
 
		FOR_ALL_VEHICLES(v) {
 
			if (v->type == VEH_TRAIN &&
 
					v->First() == v &&
 
					v->current_order.type == OT_GOTO_WAYPOINT &&
 
					v->dest_tile == wp->xy) {
 
				v->dest_tile = tile;
 
			}
 
		}
 

	
 
		RedrawWaypointSign(wp);
 
		wp->xy = tile;
 
	}
0 comments (0 inline, 0 general)