2
0
mirror of https://github.com/rehlds/metamod-r.git synced 2024-12-31 00:55:47 +03:00
metamod-r/metamod/include/common/entity_state.h

198 lines
3.7 KiB
C
Raw Normal View History

2016-07-04 09:07:29 +03:00
/***
*
2016-07-04 10:11:20 +03:00
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
2016-07-04 09:07:29 +03:00
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
2016-07-26 03:22:47 +03:00
#ifndef ENTITY_STATE_H
#define ENTITY_STATE_H
2016-07-04 09:07:29 +03:00
#ifdef _WIN32
#pragma once
#endif
2016-07-26 03:22:47 +03:00
#include "const.h"
2016-07-04 09:07:29 +03:00
// For entityType below
#define ENTITY_NORMAL (1<<0)
#define ENTITY_BEAM (1<<1)
// Entity state is used for the baseline and for delta compression of a packet of
// entities that is sent to a client.
typedef struct entity_state_s entity_state_t;
struct entity_state_s
{
// Fields which are filled in by routines outside of delta compression
int entityType;
// Index into cl_entities array for this entity.
2016-07-26 03:22:47 +03:00
int number;
2016-07-04 09:07:29 +03:00
float msg_time;
// Message number last time the player/entity state was updated.
2016-07-26 03:22:47 +03:00
int messagenum;
2016-07-04 09:07:29 +03:00
// Fields which can be transitted and reconstructed over the network stream
vec3_t origin;
vec3_t angles;
int modelindex;
int sequence;
float frame;
int colormap;
short skin;
short solid;
int effects;
float scale;
byte eflags;
// Render information
int rendermode;
int renderamt;
color24 rendercolor;
int renderfx;
int movetype;
float animtime;
float framerate;
int body;
byte controller[4];
byte blending[4];
vec3_t velocity;
// Send bbox down to client for use during prediction.
2016-07-26 03:22:47 +03:00
vec3_t mins;
2016-07-04 09:07:29 +03:00
vec3_t maxs;
int aiment;
// If owned by a player, the index of that player ( for projectiles ).
int owner;
// Friction, for prediction.
2016-07-26 03:22:47 +03:00
float friction;
2016-07-04 09:07:29 +03:00
// Gravity multiplier
2016-07-26 03:22:47 +03:00
float gravity;
2016-07-04 09:07:29 +03:00
// PLAYER SPECIFIC
int team;
int playerclass;
int health;
2016-07-26 03:22:47 +03:00
qboolean spectator;
int weaponmodel;
2016-07-04 09:07:29 +03:00
int gaitsequence;
// If standing on conveyor, e.g.
2016-07-26 03:22:47 +03:00
vec3_t basevelocity;
2016-07-04 09:07:29 +03:00
// Use the crouched hull, or the regular player hull.
2016-07-26 03:22:47 +03:00
int usehull;
2016-07-04 09:07:29 +03:00
// Latched buttons last time state updated.
2016-07-26 03:22:47 +03:00
int oldbuttons;
2016-07-04 09:07:29 +03:00
// -1 = in air, else pmove entity number
2016-07-26 03:22:47 +03:00
int onground;
2016-07-04 09:07:29 +03:00
int iStepLeft;
// How fast we are falling
2016-07-26 03:22:47 +03:00
float flFallVelocity;
2016-07-04 09:07:29 +03:00
float fov;
int weaponanim;
// Parametric movement overrides
2016-07-26 03:22:47 +03:00
vec3_t startpos;
vec3_t endpos;
float impacttime;
float starttime;
2016-07-04 09:07:29 +03:00
// For mods
int iuser1;
int iuser2;
int iuser3;
int iuser4;
float fuser1;
float fuser2;
float fuser3;
float fuser4;
vec3_t vuser1;
vec3_t vuser2;
vec3_t vuser3;
vec3_t vuser4;
};
#include "pm_info.h"
typedef struct clientdata_s
{
vec3_t origin;
vec3_t velocity;
int viewmodel;
vec3_t punchangle;
int flags;
int waterlevel;
int watertype;
vec3_t view_ofs;
float health;
int bInDuck;
int weapons; // remove?
int flTimeStepSound;
int flDuckTime;
int flSwimTime;
int waterjumptime;
float maxspeed;
float fov;
int weaponanim;
int m_iId;
int ammo_shells;
int ammo_nails;
int ammo_cells;
int ammo_rockets;
float m_flNextAttack;
int tfstate;
int pushmsec;
int deadflag;
char physinfo[ MAX_PHYSINFO_STRING ];
// For mods
int iuser1;
int iuser2;
int iuser3;
int iuser4;
float fuser1;
float fuser2;
float fuser3;
float fuser4;
vec3_t vuser1;
vec3_t vuser2;
vec3_t vuser3;
vec3_t vuser4;
} clientdata_t;
#include "weaponinfo.h"
typedef struct local_state_s
{
2016-07-26 03:22:47 +03:00
entity_state_t playerstate;
clientdata_t client;
weapon_data_t weapondata[ 64 ];
2016-07-04 09:07:29 +03:00
} local_state_t;
2016-07-26 03:22:47 +03:00
#endif // ENTITY_STATE_H