/** * Procedure testing if a ship is in (one of) the specified track bits. * @param v Vehicle to examine. * @param data Pointer to TrackBits. * @return \a v if conditions are met, else \c NULL. */ static Vehicle *EnsureNoShipOnTrackProc(Vehicle *v, void *data) { if (v->type != VEH_SHIP) return NULL; Ship *s = Ship::From(v); TrackBits tb = *(TrackBits *)data; if (s->state & tb) return v; return NULL; }