summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-04-18 22:50:37 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-04-18 22:50:37 +0200
commitc4cd45d47c01d89bab28f196f03ed9cb1978005b (patch)
treeadfdb08e894945432bcfe0f84883fb3219fd2a72 /src/core
parentChanged extraOffset value. (diff)
downloadre3-c4cd45d47c01d89bab28f196f03ed9cb1978005b.tar
re3-c4cd45d47c01d89bab28f196f03ed9cb1978005b.tar.gz
re3-c4cd45d47c01d89bab28f196f03ed9cb1978005b.tar.bz2
re3-c4cd45d47c01d89bab28f196f03ed9cb1978005b.tar.lz
re3-c4cd45d47c01d89bab28f196f03ed9cb1978005b.tar.xz
re3-c4cd45d47c01d89bab28f196f03ed9cb1978005b.tar.zst
re3-c4cd45d47c01d89bab28f196f03ed9cb1978005b.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Camera.cpp8
-rw-r--r--src/core/PlayerInfo.cpp8
-rw-r--r--src/core/References.cpp9
-rw-r--r--src/core/Streaming.cpp15
-rw-r--r--src/core/User.cpp5
-rw-r--r--src/core/World.cpp15
6 files changed, 58 insertions, 2 deletions
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index f1445d2e..6747ebf5 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -2490,6 +2490,10 @@ CCamera::TryToStartNewCamMode(int obbeMode)
TakeControl(FindPlayerEntity(), CCam::MODE_CAM_ON_A_STRING, JUMP_CUT, CAMCONTROL_OBBE);
return true;
case OBBE_COPCAR:
+#ifdef FIX_BUGS
+ if (CReplay::IsPlayingBack())
+ return false;
+#endif
if(FindPlayerPed()->m_pWanted->m_nWantedLevel < 1)
return false;
if(FindPlayerVehicle() == nil)
@@ -2514,6 +2518,10 @@ CCamera::TryToStartNewCamMode(int obbeMode)
}
return false;
case OBBE_COPCAR_WHEEL:
+#ifdef FIX_BUGS
+ if (CReplay::IsPlayingBack())
+ return false;
+#endif
if(FindPlayerPed()->m_pWanted->m_nWantedLevel < 1)
return false;
if(FindPlayerVehicle() == nil)
diff --git a/src/core/PlayerInfo.cpp b/src/core/PlayerInfo.cpp
index cfa0cea4..1c641be3 100644
--- a/src/core/PlayerInfo.cpp
+++ b/src/core/PlayerInfo.cpp
@@ -41,6 +41,10 @@ CPlayerInfo::SetPlayerSkin(char *skin)
CVector&
CPlayerInfo::GetPos()
{
+#ifdef FIX_BUGS
+ if (!m_pPed)
+ return TheCamera.GetPosition();
+#endif
if (m_pPed->InVehicle())
return m_pPed->m_pMyVehicle->GetPosition();
return m_pPed->GetPosition();
@@ -342,6 +346,10 @@ CPlayerInfo::FindClosestCarSectorList(CPtrList& carList, CPed* ped, float unk1,
void
CPlayerInfo::Process(void)
{
+#ifdef FIX_BUGS
+ if (CReplay::IsPlayingBack())
+ return;
+#endif
// Unused taxi feature. Gives you a dollar for every second with a passenger. Can be toggled via 0x29A opcode.
bool startTaxiTimer = true;
if (m_bUnusedTaxiThing && m_pPed->bInVehicle) {
diff --git a/src/core/References.cpp b/src/core/References.cpp
index 3eb2eaf3..52abbc3e 100644
--- a/src/core/References.cpp
+++ b/src/core/References.cpp
@@ -26,8 +26,17 @@ CReferences::RemoveReferencesToPlayer(void)
{
if(FindPlayerVehicle())
FindPlayerVehicle()->ResolveReferences();
+#ifdef FIX_BUGS
+ if (FindPlayerPed()) {
+ CPlayerPed* pPlayerPed = FindPlayerPed();
+ FindPlayerPed()->ResolveReferences();
+ CWorld::Players[CWorld::PlayerInFocus].m_pPed = pPlayerPed;
+ pPlayerPed->RegisterReference((CEntity**)&CWorld::Players[CWorld::PlayerInFocus].m_pPed);
+ }
+#else
if(FindPlayerPed())
FindPlayerPed()->ResolveReferences();
+#endif
}
void
diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp
index 039377f4..dae83d89 100644
--- a/src/core/Streaming.cpp
+++ b/src/core/Streaming.cpp
@@ -28,6 +28,9 @@
#include "CutsceneMgr.h"
#include "CdStream.h"
#include "Streaming.h"
+#ifdef FIX_BUGS
+#include "Replay.h"
+#endif
#include "main.h"
bool CStreaming::ms_disableStreaming;
@@ -280,7 +283,11 @@ CStreaming::Update(void)
!requestedSubway &&
!CGame::playingIntro &&
ms_numModelsRequested < 5 &&
- !CRenderer::m_loadingPriority){
+ !CRenderer::m_loadingPriority
+#ifdef FIX_BUGS
+ && !CReplay::IsPlayingBack()
+#endif
+ ){
StreamVehiclesAndPeds();
StreamZoneModels(FindPlayerCoors());
}
@@ -1248,7 +1255,11 @@ CStreaming::StreamVehiclesAndPeds(void)
static int modelQualityClass = 0;
if(CRecordDataForGame::IsRecording() ||
- CRecordDataForGame::IsPlayingBack())
+ CRecordDataForGame::IsPlayingBack()
+#ifdef FIX_BUGS
+ || CReplay::IsPlayingBack()
+#endif
+ )
return;
if(FindPlayerPed()->m_pWanted->AreSwatRequired()){
diff --git a/src/core/User.cpp b/src/core/User.cpp
index 36f07cbd..50eb7d9d 100644
--- a/src/core/User.cpp
+++ b/src/core/User.cpp
@@ -3,6 +3,7 @@
#include "Hud.h"
#include "PlayerPed.h"
+#include "Replay.h"
#include "Text.h"
#include "User.h"
#include "Vehicle.h"
@@ -115,6 +116,10 @@ CUserDisplay::Init()
void
CUserDisplay::Process()
{
+#ifdef FIX_BUGS
+ if (CReplay::IsPlayingBack())
+ return;
+#endif
PlaceName.Process();
OnscnTimer.Process();
Pager.Process();
diff --git a/src/core/World.cpp b/src/core/World.cpp
index eacb3404..7ef43593 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -1386,6 +1386,10 @@ FindPlayerEntity(void)
CVector
FindPlayerCoors(void)
{
+#ifdef FIX_BUGS
+ if (CReplay::IsPlayingBack())
+ return TheCamera.GetPosition();
+#endif
CPlayerPed *ped = FindPlayerPed();
if(ped->InVehicle())
return ped->m_pMyVehicle->GetPosition();
@@ -1396,6 +1400,11 @@ FindPlayerCoors(void)
CVector &
FindPlayerSpeed(void)
{
+#ifdef FIX_BUGS
+ static CVector vecTmpVector(0.0f, 0.0f, 0.0f);
+ if (CReplay::IsPlayingBack())
+ return vecTmpVector;
+#endif
CPlayerPed *ped = FindPlayerPed();
if(ped->InVehicle())
return ped->m_pMyVehicle->m_vecMoveSpeed;
@@ -1406,6 +1415,9 @@ FindPlayerSpeed(void)
CVector &
FindPlayerCentreOfWorld(int32 player)
{
+#ifdef FIX_BUGS
+ if(CReplay::IsPlayingBack()) return TheCamera.GetPosition();
+#endif
if(CCarCtrl::bCarsGeneratedAroundCamera) return TheCamera.GetPosition();
if(CWorld::Players[player].m_pRemoteVehicle) return CWorld::Players[player].m_pRemoteVehicle->GetPosition();
if(FindPlayerVehicle()) return FindPlayerVehicle()->GetPosition();
@@ -1415,6 +1427,9 @@ FindPlayerCentreOfWorld(int32 player)
CVector &
FindPlayerCentreOfWorld_NoSniperShift(void)
{
+#ifdef FIX_BUGS
+ if (CReplay::IsPlayingBack()) return TheCamera.GetPosition();
+#endif
if(CCarCtrl::bCarsGeneratedAroundCamera) return TheCamera.GetPosition();
if(CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle)
return CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle->GetPosition();