summaryrefslogtreecommitdiff
path: root/waypoint.c
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2006-04-05 05:22:42 +0000
committercelestar <celestar@openttd.org>2006-04-05 05:22:42 +0000
commit167faea09e0db0e5e79974a075d25810301af319 (patch)
treeea719df2c077a18b54477935bc5fc8d2b7d84445 /waypoint.c
parentaa5777c8748774237271907dab51c058d3b1c82c (diff)
downloadopenttd-167faea09e0db0e5e79974a075d25810301af319.tar.xz
(svn r4280) -Codechange: Add and make use of map accessors concerning railway waypoints
Diffstat (limited to 'waypoint.c')
-rw-r--r--waypoint.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/waypoint.c b/waypoint.c
index f06170370..dbd583e84 100644
--- a/waypoint.c
+++ b/waypoint.c
@@ -221,13 +221,13 @@ int32 CmdBuildTrainWaypoint(int x, int y, uint32 flags, uint32 p1, uint32 p2)
spec = GetCustomStation(STAT_CLASS_WAYP, GB(p1, 0, 8));
if (spec != NULL) {
- SETBIT(_m[tile].m3, 4);
+ SetCustomWaypointSprite(tile);
wp->stat_id = GB(p1, 0, 8);
wp->grfid = spec->grfid;
wp->localidx = spec->localidx;
} else {
// Specified custom graphics do not exist, so use default.
- CLRBIT(_m[tile].m3, 4);
+ ClearCustomWaypointSprite(tile);
wp->stat_id = 0;
wp->grfid = 0;
wp->localidx = 0;
@@ -293,8 +293,6 @@ int32 RemoveTrainWaypoint(TileIndex tile, uint32 flags, bool justremove)
return CMD_ERROR;
if (flags & DC_EXEC) {
- Axis direction = _m[tile].m5 & RAIL_WAYPOINT_TRACK_MASK;
-
wp = GetWaypointByTile(tile);
wp->deleted = 30; // let it live for this many days before we do the actual deletion.
@@ -305,7 +303,7 @@ int32 RemoveTrainWaypoint(TileIndex tile, uint32 flags, bool justremove)
MarkTileDirtyByTile(tile);
} else {
DoClearSquare(tile);
- SetSignalsOnBothDir(tile, direction == AXIS_X ? TRACK_X : TRACK_Y);
+ SetSignalsOnBothDir(tile, GetRailWaypointTrack(tile));
}
}