summaryrefslogtreecommitdiffstats
path: root/src/weapons
diff options
context:
space:
mode:
Diffstat (limited to 'src/weapons')
-rw-r--r--src/weapons/Weapon.cpp8
-rw-r--r--src/weapons/Weapon.h7
2 files changed, 14 insertions, 1 deletions
diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp
index 90a6408b..0fc89637 100644
--- a/src/weapons/Weapon.cpp
+++ b/src/weapons/Weapon.cpp
@@ -5,7 +5,9 @@
#include "WeaponInfo.h"
WRAPPER bool CWeapon::Fire(CEntity*, CVector*) { EAXJMP(0x55C380); }
+WRAPPER void CWeapon::FireFromCar(CAutomobile *car, bool left) { EAXJMP(0x55C940); }
WRAPPER void CWeapon::AddGunshell(CEntity*, CVector const&, CVector2D const&, float) { EAXJMP(0x55F770); }
+WRAPPER void CWeapon::Update(int32 audioEntity) { EAXJMP(0x563A10); }
void
CWeapon::Initialise(eWeaponType type, int ammo)
@@ -36,6 +38,12 @@ CWeapon::Reload(void)
}
bool
+CWeapon::IsType2Handed(void)
+{
+ return m_eWeaponType >= WEAPONTYPE_SHOTGUN && m_eWeaponType <= WEAPONTYPE_FLAMETHROWER && m_eWeaponType != WEAPONTYPE_ROCKETLAUNCHER;
+}
+
+bool
CWeapon::IsTypeMelee(void)
{
return m_eWeaponType == WEAPONTYPE_UNARMED || m_eWeaponType == WEAPONTYPE_BASEBALLBAT;
diff --git a/src/weapons/Weapon.h b/src/weapons/Weapon.h
index 81516c4e..71fe1f45 100644
--- a/src/weapons/Weapon.h
+++ b/src/weapons/Weapon.h
@@ -1,5 +1,4 @@
#pragma once
-#include "Entity.h"
enum eWeaponType
{
@@ -46,6 +45,9 @@ enum eWeaponState
WEAPONSTATE_MELEE_MADECONTACT
};
+class CEntity;
+class CAutomobile;
+
class CWeapon
{
public:
@@ -61,9 +63,12 @@ public:
}
void Initialise(eWeaponType type, int ammo);
+ void Update(int32 audioEntity);
void Reload(void);
bool Fire(CEntity*, CVector*);
+ void FireFromCar(CAutomobile *car, bool left);
void AddGunshell(CEntity*, CVector const&, CVector2D const&, float);
bool IsTypeMelee(void);
+ bool IsType2Handed(void);
};
static_assert(sizeof(CWeapon) == 0x18, "CWeapon: error");