A new structure has been added for dealing with player tank states.
Code: Select all
typedef enum
{
eDead, // not alive, not paused, etc.
eAlive, // player is alive
ePaused, // player is paused
eExploding, // currently blowing up
eTeleporting, // teleported recently
eInBuilding // has OO and is in a building
}bz_ePlayerStatus;
typedef struct bz_PlayerUpdateState
{
bz_ePlayerStatus status; // special states
bool falling; // not driving on the ground or an obstacle
bool crossingWall; // crossing an obstacle wall
bool inPhantomZone; // zoned
float pos[3]; // position of tank
float velocity[3]; // velocity of tank
float rotation; // orientation of tank
float angVel; // angular velocity of tank
int phydrv; // physics driver
}bz_PlayerUpdateState;
The bz_PlayerUpdateEventData_V1 now contains this structure as the state member and contains the state data from the player update.
bz_BasePlayerRecord contains 2 state structs, lastKnownState, for the state of the last update, and currentState for the currently interpolated state. lastUpdateTime has also been added to mark the time of the last known state.
last but not least;
Code: Select all
BZF_API bool bz_getPlayerCurrentState ( int playerID, bz_PlayerUpdateState &state );
bz_PlayerUpdateState is also used by the bz_ServerSidePlayerHandler class for server side players (bots).
***NOTE***
these changes are only for 2.1, they do not affect 2.0.x an any existing plug-ins.