# HG changeset patch # User peter1138 # Date 1129874657 0 # Node ID 50b42e72a6f101bd53b8d5de33bbb4b02e48d708 # Parent aa71b3d576ce6d38656b033284babe3cad1a5950 (svn r3075) -PBS: Keep track reservation state while building and removing a waypoint. diff -r aa71b3d576ce -r 50b42e72a6f1 waypoint.c --- a/waypoint.c Thu Oct 20 19:44:41 2005 +0000 +++ b/waypoint.c Fri Oct 21 06:04:17 2005 +0000 @@ -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 @@ } 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 @@ RedrawWaypointSign(wp); if (justremove) { + bool reserved = PBSTileReserved(tile) != 0; ModifyTile(tile, MP_MAP5, 1<