summaryrefslogtreecommitdiff
path: root/roadveh_cmd.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2005-04-11 20:54:25 +0000
committerDarkvater <darkvater@openttd.org>2005-04-11 20:54:25 +0000
commit2397ff86e65b2569fbc9e14e70991f44c29a0db6 (patch)
treeed024e987f57f23fee9bfa53bbd1a640d8ebd288 /roadveh_cmd.c
parent90cc36f7e2466f102668073e0d1f104f30912887 (diff)
downloadopenttd-2397ff86e65b2569fbc9e14e70991f44c29a0db6.tar.xz
(svn r2184) - CodeChange: remove the copy of ClearSlot(), which is now also called for CmdSkipOrder(). This also fixes the involuntary crash introduced 2 revisions ago
Diffstat (limited to 'roadveh_cmd.c')
-rw-r--r--roadveh_cmd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/roadveh_cmd.c b/roadveh_cmd.c
index 5accdf632..7106ce3d1 100644
--- a/roadveh_cmd.c
+++ b/roadveh_cmd.c
@@ -229,13 +229,16 @@ int32 CmdStartStopRoadVeh(int x, int y, uint32 flags, uint32 p1, uint32 p2)
return 0;
}
-static inline void ClearSlot(Vehicle *v, RoadStop *rs)
+void ClearSlot(Vehicle *v, RoadStop *rs)
{
DEBUG(ms, 3) ("Multistop: Clearing slot %d at 0x%x", v->u.road.slotindex, rs->xy);
v->u.road.slot = NULL;
v->u.road.slot_age = 0;
- if (rs != NULL)
+ if (rs != NULL) {
+ // check that the slot is indeed assigned to the same vehicle
+ assert(rs->slot[v->u.road.slotindex] == v->index);
rs->slot[v->u.road.slotindex] = INVALID_SLOT;
+ }
}
// p1 = vehicle index in GetVehicle()