Browse Source

Add unpredicted weapon wrapper class

gravgun
mittorn 8 years ago
parent
commit
ac87c8f8c7
  1. 1
      dlls/Android.mk
  2. 24
      dlls/unpredictedweapon.cpp
  3. 17
      dlls/unpredictedweapon.h

1
dlls/Android.mk

@ -129,6 +129,7 @@ LOCAL_SRC_FILES := agrunt.cpp airtank.cpp \ @@ -129,6 +129,7 @@ LOCAL_SRC_FILES := agrunt.cpp airtank.cpp \
gravgun.cpp \
ar2.cpp \
big_cock.cpp \
unpredictedweapon.cpp \
../pm_shared/pm_debug.c \
../pm_shared/pm_math.c \
../pm_shared/pm_shared.c \

24
dlls/unpredictedweapon.cpp

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
#include "extdll.h"
#include "util.h"
#include "cbase.h"
#include "unpredictedweapon.h"
BOOL CBasePlayerWeaponU::UseDecrement()
{
return FALSE;
}
float CBasePlayerWeaponU::UTIL_WeaponTimeBase()
{
return gpGlobals->time;
}
TYPEDESCRIPTION CBasePlayerWeaponU::m_SaveData[] =
{
DEFINE_FIELD( CBasePlayerWeapon, m_flNextPrimaryAttack, FIELD_TIME ),
DEFINE_FIELD( CBasePlayerWeapon, m_flNextSecondaryAttack, FIELD_TIME ),
DEFINE_FIELD( CBasePlayerWeapon, m_flTimeWeaponIdle, FIELD_TIME ),
};
IMPLEMENT_SAVERESTORE( CBasePlayerWeaponU, CBasePlayerWeapon )

17
dlls/unpredictedweapon.h

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
#ifndef UNPREDICTEDWEAPON_H
#define UNPREDICTEDWEAPON_H
#include "weapons.h"
class CBasePlayerWeaponU: CBasePlayerWeapon
{
public:
virtual int Save( CSave &save );
virtual int Restore( CRestore &restore );
static TYPEDESCRIPTION m_SaveData[];
BOOL UseDecrement( void );
float UTIL_WeaponTimeBase();
};
#endif // UNPREDICTEDWEAPON_H
Loading…
Cancel
Save