Add unpredicted weapon wrapper class

This commit is contained in:
mittorn 2017-02-24 14:16:58 +00:00
parent 316edf139b
commit ac87c8f8c7
3 changed files with 42 additions and 0 deletions

View File

@ -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 \

View File

@ -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 Normal file
View File

@ -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