Loading

Paste #p5mqfcanm

  1. /**
  2.  * Procedure testing if a ship is in (one of) the specified track bits.
  3.  * @param v Vehicle to examine.
  4.  * @param data Pointer to TrackBits.
  5.  * @return \a v if conditions are met, else \c NULL.
  6.  */
  7. static Vehicle *EnsureNoShipOnTrackProc(Vehicle *v, void *data)
  8. {
  9.     if (v->type != VEH_SHIP) return NULL;
  10.  
  11.     Ship *s = Ship::From(v);
  12.     TrackBits tb = *(TrackBits *)data;
  13.     if (s->state & tb) return v;
  14.  
  15.     return NULL;
  16. }

Comments