summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-07-26 01:34:32 +0200
committerGitHub <noreply@github.com>2019-07-26 01:34:32 +0200
commit8804aafc6a9f7cd69f51e248546d2f889e65c242 (patch)
treef86d3d0e5b4ec32026775eb9ede17e894d6ca40e /src/core
parentRunning script part 3 (diff)
parentMerge pull request #162 from erorcun/erorcun (diff)
downloadre3-8804aafc6a9f7cd69f51e248546d2f889e65c242.tar
re3-8804aafc6a9f7cd69f51e248546d2f889e65c242.tar.gz
re3-8804aafc6a9f7cd69f51e248546d2f889e65c242.tar.bz2
re3-8804aafc6a9f7cd69f51e248546d2f889e65c242.tar.lz
re3-8804aafc6a9f7cd69f51e248546d2f889e65c242.tar.xz
re3-8804aafc6a9f7cd69f51e248546d2f889e65c242.tar.zst
re3-8804aafc6a9f7cd69f51e248546d2f889e65c242.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Camera.cpp11
-rw-r--r--src/core/Camera.h2
-rw-r--r--src/core/Explosion.h12
-rw-r--r--src/core/PlayerInfo.h8
-rw-r--r--src/core/re3.cpp2
5 files changed, 29 insertions, 6 deletions
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 &center, 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");
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 edcdad27..a5f69122 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);