Game Entity (MW2)

From COD Engine Research
Jump to: navigation, search
/* entityState_s->eType */
enum entityType_t
{
  ET_GENERAL = 0x0,
  ET_PLAYER = 0x1,
  ET_PLAYER_CORPSE = 0x2,
  ET_ITEM = 0x3,
  ET_MISSILE = 0x4,
  ET_INVISIBLE = 0x5,
  ET_SCRIPTMOVER = 0x6,
  ET_SOUND_BLEND = 0x7,
  ET_FX = 0x8,
  ET_LOOP_FX = 0x9,
  ET_PRIMARY_LIGHT = 0xA,
  ET_TURRET = 0xB,
  ET_HELICOPTER = 0xC,
  ET_PLANE = 0xD,
  ET_VEHICLE = 0xE,
  ET_VEHICLE_COLLMAP = 0xF,
  ET_VEHICLE_CORPSE = 0x10,
  ET_VEHICLE_SPAWNER = 0x11
};
 
/* gentity_s->flags */
#define FL_GODMODE 0x1
#define FL_DEMI_GODMODE 0x2
#define FL_NO_KNOCKBACK 0x8
#define FL_CAN_RADIUS_DAMAGE 0x10
#define FL_SUPPORTS_LINKTO 0x1000
#define FL_GRENADE_TOUCH_DAMAGE 0x4000
#define FL_STABLE_MISSILES 0x20000
 
struct LerpEntityStatePlayer
{
  int leanf;
  int movementDir;
  int torsoPitch;
  int waistPitch;
  int offhandWeapon;
  int lastSpawnTime;
};
 
struct LerpEntityStateAnonymous
{
  int data[9];
};
 
struct LerpEntityStateMissile
{
  int launchTime;
  int flightMode;
};
 
struct LerpEntityStateScriptMover
{
  int entToTakeMarksFrom;
  int xModelIndex;
  int animIndex;
  int animTime;
};
 
struct LerpEntityStateSoundBlend
{
  int lerp;
};
 
struct LerpEntityStateLoopFx
{
  int cullDist;
  int period;
};
 
struct LerpEntityStateTurret
{
  float gunAngles[3];
  int lastBarrelRotChangeTime;
  int lastBarrelRotChangeRate;
  int lastHeatChangeTime;
  int lastHeatChangeLevel;
};
 
struct LerpEntityStateVehicle
{
  int indices;
  int flags;
  int bodyPitch;
  int bodyRoll;
  int steerYaw;
  int gunPitch;
  int gunYaw;
  int playerIndex;
  int pad;
};
 
struct LerpEntityStatePlane
{
  int ownerNum;
  int enemyIcon;
  int friendIcon;
};
 
union LerpEntityStateTypeUnion
{
  LerpEntityStateTurret turret;
  LerpEntityStateLoopFx loopFx;
  LerpEntityStatePlayer player;
  LerpEntityStateScriptMover scriptMover;
  LerpEntityStateVehicle vehicle;
  LerpEntityStatePlane plane;
  LerpEntityStateMissile missile;
  LerpEntityStateSoundBlend soundBlend;
  LerpEntityStateAnonymous anonymous;
};
 
struct trajectory_t
{
  trType_t trType;
  int trTime;
  int trDuration;
  float trBase[3];
  float trDelta[3];
};
 
struct LerpEntityState
{
  int eFlags;
  trajectory_t pos;
  trajectory_t apos;
  LerpEntityStateTypeUnion u;
};
 
struct entityState_s
{
  int number;	// 0x0
  int eType;	// 0x4
  LerpEntityState lerp;	// 0x8
  int time2;	// 0x78
  int otherEntityNum;	// 0x7C
  int attackerEntityNum;	// 0x80
  int groundEntityNum;	// 0x84
  int loopSound;	// 0x88
  int surfType;	// 0x8C
  union
  {
    int brushmodel;
    int item;
    int xmodel;
    int primaryLight;
  } index;	// 0x90
  int clientNum;	// 0x94
  int iHeadIcon;	// 0x98
  int iHeadIconTeam;	// 0x9C
  int solid;	// 0xA0
  int eventParm;	// 0xA4
  int eventSequence;	// 0xA8
  int events[4];	// 0xAC
  int eventParms[4];	// 0xBC
  int wes;	// 0xCC
  int legsAnim;	// 0xD0
  int torsoAnim;	// 0xD4
  union
  {
    int scale;
    int eventParm2;
    int helicopterStage;
  } un1;	// 0xD8
  union
  {
    int hintString;
    int grenadeInPickupRange;
    int vehicleXModel;
  } un2;	// 0xDC
  int clientLinkInfo;	// 0xE0
  int partBits[6];	// 0xE4
};
 
struct enitityShared_t
{
  int clientMask;	// 0x0
  char linked;	// 0x4
  char bmodel;	// 0x5
  char svFlags;	// 0x6
  char inuse;	// 0x7
  float mins[3];	// 0x8
  float maxs[3];	// 0x14
  int contents;	// 0x20
  float absmin[3];	// 0x24
  float absmax[3];	// 0x30
  float currentOrigin[3];	// 0x3C
  float currentAngles[3];	// 0x48
  EntHandle ownerNum;	// 0x54
  int eventTime;	// 0x58
};
 
struct gentity_s
{
  entityState_s s; // 0x0
  enitityShared_t r; // 0xFC
  gclient_s *client; // 0x158
  turretInfo_s *pTurretInfo; // 0x15C
  scr_vehicle_s *scr_vehicle; // 0x160
  dxBody *physicsBody; // 0x164
  __int16 model; // 0x168
  char physicsObject; // 0x16A
  char takedamage;  // 0x16B
  char active; // 0x16C
  char handler; // 0x16D
  char team; // 0x16E
  char freeAfterEvent; 0x16F
  unsigned __int16 code_classname; // 0x172
  unsigned __int16 classname; // 0x174
  unsigned __int16 script_linkname; // 0x176
  unsigned __int16 target; // 0x178
  unsigned __int16 targetname; // 0x17A
  int attachIgnoreCollision; // 0x17C
  int spawnFlags; // 0x180
  int flags; // 0x184
  int unlinkAfterEvent; // 0x188
  int clipMask;  // 0x18C
  int processedFrame; // 0x190
  EntHandle parent; // 0x194
  int nextthink; // 0x198
  int health; // 0x19C
  int maxhealth; // 0x1A0
  int damage; // 0x1A4
  int count; // 0x1A8
  union	// 0x1AC
  {
    item_ent_t item[2];
    trigger_ent_t trigger;
    mover_ent_t mover;
    corpse_ent_t corpse;
  };
  EntHandle projEntity;	// 0x20C
  EntHandle linkedEntity;// 0x210
  int tagInfo;	// 0x214
  gentity_s *tagChildren;// 0x218
  unsigned __int16 attachModelNames[19];// 0x21C
  unsigned __int16 attachTagNames[19];// 0x242
  int useCount;	// 0x268
  int nextFree;	// 0x26C
  int birthtime; // 0x270
#ifdef PS3
  char unknown[0xC]; // 0x274
#endif
};