From 21ce0a4b28a1842dad91433362d250089ec491b8 Mon Sep 17 00:00:00 2001 From: aap Date: Sun, 31 May 2020 17:05:49 +0200 Subject: CAutomobile done --- src/weapons/Explosion.cpp | 2 +- src/weapons/Explosion.h | 3 ++- src/weapons/Weapon.cpp | 12 ++++++++++++ src/weapons/Weapon.h | 1 + 4 files changed, 16 insertions(+), 2 deletions(-) (limited to 'src/weapons') diff --git a/src/weapons/Explosion.cpp b/src/weapons/Explosion.cpp index d0a68279..f4ad346d 100644 --- a/src/weapons/Explosion.cpp +++ b/src/weapons/Explosion.cpp @@ -86,7 +86,7 @@ CExplosion::GetExplosionPosition(uint8 id) } bool -CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type, const CVector &pos, uint32 lifetime) +CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type, const CVector &pos, uint32 lifetime, bool unk) { CVector pPosn; CVector posGround; diff --git a/src/weapons/Explosion.h b/src/weapons/Explosion.h index bf54328c..c8539cca 100644 --- a/src/weapons/Explosion.h +++ b/src/weapons/Explosion.h @@ -40,7 +40,8 @@ public: static void ResetExplosionActiveCounter(uint8 id); static uint8 GetExplosionType(uint8 id); static CVector *GetExplosionPosition(uint8 id); - static bool AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type, const CVector &pos, uint32 lifetime); +// TODO(MIAMI): that new parameter + static bool AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type, const CVector &pos, uint32 lifetime, bool unk = true); static void Update(); static bool TestForExplosionInArea(eExplosionType type, float x1, float x2, float y1, float y2, float z1, float z2); static void RemoveAllExplosionsInArea(CVector pos, float radius); diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp index 0ac37e31..b2ac2ad2 100644 --- a/src/weapons/Weapon.cpp +++ b/src/weapons/Weapon.cpp @@ -113,6 +113,18 @@ CWeapon::UpdateWeapons(void) CBulletInfo::Update(); } +//--MIAMI: done +CWeapon::CWeapon(eWeaponType type, int32 ammo) +{ + m_eWeaponType = type; + m_eWeaponState = WEAPONSTATE_READY; + m_nAmmoTotal = Min(ammo, 99999); + m_nAmmoInClip = 0; + Reload(); + m_nTimer = 0; + m_bAddRotOffset = false; +} + // --MIAMI: Done void CWeapon::Initialise(eWeaponType type, int32 ammo) diff --git a/src/weapons/Weapon.h b/src/weapons/Weapon.h index b4ed93c3..8680fdcf 100644 --- a/src/weapons/Weapon.h +++ b/src/weapons/Weapon.h @@ -25,6 +25,7 @@ public: CWeapon() { m_bAddRotOffset = false; } + CWeapon(eWeaponType type, int32 ammo); CWeaponInfo *GetInfo(); -- cgit v1.2.3