Changeset - r2546:7f5e0a3bcf27
[Not reviewed]
master
0 1 0
peter1138 - 18 years ago 2005-10-21 06:04:17
peter1138@openttd.org
(svn r3075) -PBS: Keep track reservation state while building and removing a waypoint.
1 file changed with 5 insertions and 0 deletions:
0 comments (0 inline, 0 general)
waypoint.c
Show inline comments
 
@@ -14,6 +14,7 @@
 
#include "town.h"
 
#include "waypoint.h"
 
#include "variables.h"
 
#include "pbs.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 

	
 
@@ -197,12 +198,14 @@ int32 CmdBuildTrainWaypoint(int x, int y
 
	}
 

	
 
	if (flags & DC_EXEC) {
 
		bool reserved = PBSTileReserved(tile) != 0;
 
		ModifyTile(tile, MP_MAP5, RAIL_TYPE_WAYPOINT | dir);
 
		if (--p1 & 0x100) { // waypoint type 0 uses default graphics
 
			// custom graphics
 
			_m[tile].m3 |= 16;
 
			_m[tile].m4 = p1 & 0xff;
 
		}
 
		if (reserved) PBSReserveTrack(tile, dir);
 

	
 
		wp->deleted = 0;
 
		wp->xy = tile;
 
@@ -272,9 +275,11 @@ int32 RemoveTrainWaypoint(TileIndex tile
 
		RedrawWaypointSign(wp);
 

	
 
		if (justremove) {
 
			bool reserved = PBSTileReserved(tile) != 0;
 
			ModifyTile(tile, MP_MAP5, 1<<direction);
 
			_m[tile].m3 &= ~16;
 
			_m[tile].m4 = 0;
 
			if (reserved) PBSReserveTrack(tile, direction);
 
		} else {
 
			DoClearSquare(tile);
 
			SetSignalsOnBothDir(tile, direction);
0 comments (0 inline, 0 general)