summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKUDr <KUDr@openttd.org>2007-04-29 10:14:42 +0000
committerKUDr <KUDr@openttd.org>2007-04-29 10:14:42 +0000
commit1f627254c36a643afc0da593116f3352d078bdf9 (patch)
tree4587d00a65021e364c83bd116513848990d77080 /src
parentb0eeaea3cd283518eb2cf638be5b29d8bfc2c4e3 (diff)
downloadopenttd-1f627254c36a643afc0da593116f3352d078bdf9.tar.xz
(svn r9746) -Codechange [YAPF]: added DEBUGs level 0 if the current train order is OT_GOTO_WAYPOINT and waypoint is invalid or v->dest_tile is wrong
Diffstat (limited to 'src')
-rw-r--r--src/yapf/yapf_destrail.hpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/yapf/yapf_destrail.hpp b/src/yapf/yapf_destrail.hpp
index 5b44d805c..10233cda1 100644
--- a/src/yapf/yapf_destrail.hpp
+++ b/src/yapf/yapf_destrail.hpp
@@ -95,8 +95,16 @@ public:
case OT_GOTO_WAYPOINT: {
Waypoint *wp = GetWaypoint(v->current_order.dest);
- if (wp == NULL) break;
+ if (wp == NULL) {
+ /* Invalid waypoint in orders! */
+ DEBUG(yapf, 0, "Invalid waypoint in orders == 0x%04X (train %d, player %d)", v->current_order.dest, v->unitnumber, (PlayerID)v->owner);
+ break;
+ }
m_destTile = wp->xy;
+ if (m_destTile != v->dest_tile) {
+ /* Something is wrong with orders! */
+ DEBUG(yapf, 0, "Invalid v->dest_tile == 0x%04X (train %d, player %d)", v->dest_tile, v->unitnumber, (PlayerID)v->owner);
+ }
m_dest_station_id = INVALID_STATION;
m_destTrackdirs = TrackToTrackdirBits(AxisToTrack(GetWaypointAxis(wp->xy)));
break;