mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-06-20 12:09:32 +01:00
(svn r3140) Building/removing a waypoint could leave old PBS reservations behind. This ensures they are cleared.
This commit is contained in:
parent
267314b4d0
commit
0412040bcc
12
waypoint.c
12
waypoint.c
@ -205,7 +205,11 @@ int32 CmdBuildTrainWaypoint(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||
_m[tile].m3 |= 16;
|
||||
_m[tile].m4 = p1 & 0xff;
|
||||
}
|
||||
if (reserved) PBSReserveTrack(tile, dir);
|
||||
if (reserved) {
|
||||
PBSReserveTrack(tile, dir);
|
||||
} else {
|
||||
PBSClearTrack(tile, dir);
|
||||
}
|
||||
|
||||
wp->deleted = 0;
|
||||
wp->xy = tile;
|
||||
@ -279,7 +283,11 @@ int32 RemoveTrainWaypoint(TileIndex tile, uint32 flags, bool justremove)
|
||||
ModifyTile(tile, MP_MAP5, 1<<direction);
|
||||
_m[tile].m3 &= ~16;
|
||||
_m[tile].m4 = 0;
|
||||
if (reserved) PBSReserveTrack(tile, direction);
|
||||
if (reserved) {
|
||||
PBSReserveTrack(tile, direction);
|
||||
} else {
|
||||
PBSClearTrack(tile, direction);
|
||||
}
|
||||
} else {
|
||||
DoClearSquare(tile);
|
||||
SetSignalsOnBothDir(tile, direction);
|
||||
|
Loading…
Reference in New Issue
Block a user