roadveh_cmd.c
changeset 1680 2d69b69f7b17
parent 1665 ad61a6a27fca
child 1698 3f979f9ecf6c
--- a/roadveh_cmd.c	Mon Apr 11 20:19:41 2005 +0000
+++ b/roadveh_cmd.c	Mon Apr 11 20:54:25 2005 +0000
@@ -229,13 +229,16 @@
 	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()