struct CompCar // Car info in 28 bytes - there is an array of these in the MCI (below)
{
word Node; // current path node
word Lap; // current lap
byte PLID; // player's unique id
byte Position; // current race position : 0 = unknown, 1 = leader, etc...
byte Info; // flags and other info - see below
byte Sp3;
int X; // X map (65536 = 1 metre)
int Y; // Y map (65536 = 1 metre)
int Z; // Z alt (65536 = 1 metre)
word Speed; // speed (32768 = 100 m/s)
word Direction; // direction of car's motion : 0 = world y direction, 32768 = 180 deg
word Heading; // direction of forward axis : 0 = world y direction, 32768 = 180 deg
short AngVel; // signed, rate of change of heading : (16384 = 360 deg/s)
};
// NOTE 1) Info byte - the bits in this byte have the following meanings :
#define CCI_BLUE 1 // this car is in the way of a driver who is a lap ahead
#define CCI_YELLOW 2 // this car is slow or stopped and in a dangerous place
#define CCI_LAG 32 // this car is lagging (missing or delayed position packets)
[B] #define CCI_FIRST 64 // this is the first compcar in this set of MCI packets
#define CCI_LAST 128 // this is the last compcar in this set of MCI packets[/B]
static int player_number = 0;
for (int i = 0; i < MCI.NumC; i++)
{
Players[player_number].CompCar.AngVel = MCI.Info[i].AngVel;
..
..
..
if ( (MCI.Info[i].Info & CCI_LAST) == CCI_LAST)
player_number = 0;
else
player_number++;
}