From 3bb607f9cbc3d26a1b312f61f86ce3f42ef82a94 Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 25 Jul 2019 16:33:37 +0200 Subject: implemented CAutomobile::TankControl --- src/core/Explosion.h | 12 ++++++++++-- src/core/PlayerInfo.h | 8 ++++---- src/core/re3.cpp | 2 ++ 3 files changed, 16 insertions(+), 6 deletions(-) (limited to 'src/core') diff --git a/src/core/Explosion.h b/src/core/Explosion.h index 69508490..93d60ab3 100644 --- a/src/core/Explosion.h +++ b/src/core/Explosion.h @@ -4,8 +4,16 @@ class CEntity; enum eExplosionType { - EXPLOSION_3 = 3, - EXPLOSION_4 + EXPLOSION_GRENADE, + EXPLOSION_MOLOTOV, + EXPLOSION_ROCKET, + EXPLOSION_CAR, + EXPLOSION_CAR_QUICK, + EXPLOSION_HELI, + EXPLOSION_MINE, + EXPLOSION_BARREL, + EXPLOSION_TANK_GRENADE, + EXPLOSION_HELI_BOMB }; class CExplosion diff --git a/src/core/PlayerInfo.h b/src/core/PlayerInfo.h index d8128424..9327b9a0 100644 --- a/src/core/PlayerInfo.h +++ b/src/core/PlayerInfo.h @@ -45,10 +45,10 @@ public: int8 field_225; int8 field_226; int8 field_227; - int32 m_nTimeLostRemoteCar; - int32 m_nTimeLastHealthLoss; - int32 m_nTimeLastArmourLoss; - int32 field_240; + uint32 m_nTimeLostRemoteCar; + uint32 m_nTimeLastHealthLoss; + uint32 m_nTimeLastArmourLoss; + uint32 m_nTimeTankShotGun; int32 m_nUpsideDownCounter; int32 field_248; int16 m_nTrafficMultiplier; diff --git a/src/core/re3.cpp b/src/core/re3.cpp index a0032bc6..6566a282 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -296,6 +296,8 @@ DebugMenuPopulate(void) DebugMenuAddCmd("Spawn", "Spawn Banshee", [](){ SpawnCar(MI_BANSHEE); }); DebugMenuAddCmd("Spawn", "Spawn Yakuza", [](){ SpawnCar(MI_YAKUZA); }); DebugMenuAddCmd("Spawn", "Spawn Dodo", [](){ SpawnCar(MI_DODO); }); + DebugMenuAddCmd("Spawn", "Spawn Rhino", [](){ SpawnCar(MI_RHINO); }); + DebugMenuAddCmd("Spawn", "Spawn Firetruck", [](){ SpawnCar(MI_FIRETRUCK); }); DebugMenuAddCmd("Debug", "Fix Car", FixCar); -- cgit v1.2.3 From 8fd63e5ca6288e0f16c63fa9f378682b31dbaf88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Thu, 25 Jul 2019 18:06:24 +0300 Subject: Ped & fixes, including peds dive into danger fix --- src/core/Camera.cpp | 11 +++++++++++ src/core/Camera.h | 2 ++ 2 files changed, 13 insertions(+) (limited to 'src/core') diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp index a66d6ac9..b5ba76db 100644 --- a/src/core/Camera.cpp +++ b/src/core/Camera.cpp @@ -1304,6 +1304,17 @@ CCam::GetWeaponFirstPersonOn() return false; } +float +CCamera::Find3rdPersonQuickAimPitch(void) +{ + float clampedFrontZ = clamp(Cams[ActiveCam].Front.z, -1.0f, 1.0f); + + // float rot = atan2(clampedFrontZ, sqrt(1.0f - sq(clampedFrontZ))); + float rot = Asin(clampedFrontZ); + + return -(DEGTORAD(((0.5f - m_f3rdPersonCHairMultY) * 1.8f * 0.5f * Cams[ActiveCam].FOV)) + rot); +} + STARTPATCHES InjectHook(0x42C760, (bool (CCamera::*)(const CVector ¢er, float radius, const CMatrix *mat))&CCamera::IsSphereVisible, PATCH_JUMP); InjectHook(0x46FD00, &CCamera::SetFadeColour, PATCH_JUMP); diff --git a/src/core/Camera.h b/src/core/Camera.h index 1a2aae79..3ce0d9a6 100644 --- a/src/core/Camera.h +++ b/src/core/Camera.h @@ -469,6 +469,8 @@ int m_iModeObbeCamIsInForCar; void Restore(void); void SetWidescreenOff(void); + float Find3rdPersonQuickAimPitch(void); + void dtor(void) { this->CCamera::~CCamera(); } }; static_assert(offsetof(CCamera, m_WideScreenOn) == 0x70, "CCamera: error"); -- cgit v1.2.3