replays bug fix
This commit is contained in:
parent
522d14814f
commit
c4cd45d47c
@ -12,6 +12,9 @@
|
|||||||
#include "AudioScriptObject.h"
|
#include "AudioScriptObject.h"
|
||||||
#include "RpAnimBlend.h"
|
#include "RpAnimBlend.h"
|
||||||
#include "AnimBlendAssociation.h"
|
#include "AnimBlendAssociation.h"
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
#include "Replay.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
CPhoneInfo gPhoneInfo;
|
CPhoneInfo gPhoneInfo;
|
||||||
|
|
||||||
@ -45,6 +48,10 @@ isPhoneAvailable(int m_phoneId)
|
|||||||
void
|
void
|
||||||
CPhoneInfo::Update(void)
|
CPhoneInfo::Update(void)
|
||||||
{
|
{
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
if (CReplay::IsPlayingBack())
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
CPlayerPed *player = FindPlayerPed();
|
CPlayerPed *player = FindPlayerPed();
|
||||||
CPlayerInfo *playerInfo = &CWorld::Players[CWorld::PlayerInFocus];
|
CPlayerInfo *playerInfo = &CWorld::Players[CWorld::PlayerInFocus];
|
||||||
if (bDisplayingPhoneMessage && CTimer::GetTimeInMilliseconds() > PhoneEnableControlsTimer) {
|
if (bDisplayingPhoneMessage && CTimer::GetTimeInMilliseconds() > PhoneEnableControlsTimer) {
|
||||||
|
@ -68,8 +68,8 @@ bool CReplay::bReplayEnabled = true;
|
|||||||
uint32 CReplay::SlowMotion;
|
uint32 CReplay::SlowMotion;
|
||||||
uint32 CReplay::FramesActiveLookAroundCam;
|
uint32 CReplay::FramesActiveLookAroundCam;
|
||||||
bool CReplay::bDoLoadSceneWhenDone;
|
bool CReplay::bDoLoadSceneWhenDone;
|
||||||
CPtrList CReplay::WorldPtrList;
|
CPtrNode* CReplay::WorldPtrList;
|
||||||
CPtrList CReplay::BigBuildingPtrList;
|
CPtrNode* CReplay::BigBuildingPtrList;
|
||||||
CWanted CReplay::PlayerWanted;
|
CWanted CReplay::PlayerWanted;
|
||||||
CPlayerInfo CReplay::PlayerInfo;
|
CPlayerInfo CReplay::PlayerInfo;
|
||||||
uint32 CReplay::Time1;
|
uint32 CReplay::Time1;
|
||||||
@ -101,6 +101,9 @@ bool CReplay::bPlayerInRCBuggy;
|
|||||||
float CReplay::fDistanceLookAroundCam;
|
float CReplay::fDistanceLookAroundCam;
|
||||||
float CReplay::fBetaAngleLookAroundCam;
|
float CReplay::fBetaAngleLookAroundCam;
|
||||||
float CReplay::fAlphaAngleLookAroundCam;
|
float CReplay::fAlphaAngleLookAroundCam;
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
int CReplay::nHandleOfPlayerPed[NUMPLAYERS];
|
||||||
|
#endif
|
||||||
|
|
||||||
static void(*CBArray[])(CAnimBlendAssociation*, void*) =
|
static void(*CBArray[])(CAnimBlendAssociation*, void*) =
|
||||||
{
|
{
|
||||||
@ -275,7 +278,7 @@ void CReplay::RecordThisFrame(void)
|
|||||||
continue;
|
continue;
|
||||||
memory_required += sizeof(tBulletTracePacket);
|
memory_required += sizeof(tBulletTracePacket);
|
||||||
}
|
}
|
||||||
memory_required += sizeof(tEndOfFramePacket);
|
memory_required += sizeof(tEndOfFramePacket) + 1; // 1 for Record.m_pBase[Record.m_nOffset] = REPLAYPACKET_END;
|
||||||
if (Record.m_nOffset + memory_required > REPLAYBUFFERSIZE) {
|
if (Record.m_nOffset + memory_required > REPLAYBUFFERSIZE) {
|
||||||
Record.m_pBase[Record.m_nOffset] = REPLAYPACKET_END;
|
Record.m_pBase[Record.m_nOffset] = REPLAYPACKET_END;
|
||||||
BufferStatus[Record.m_bSlot] = REPLAYBUFFER_PLAYBACK;
|
BufferStatus[Record.m_bSlot] = REPLAYBUFFER_PLAYBACK;
|
||||||
@ -1108,6 +1111,10 @@ void CReplay::TriggerPlayback(uint8 cam_mode, float cam_x, float cam_y, float ca
|
|||||||
|
|
||||||
void CReplay::StoreStuffInMem(void)
|
void CReplay::StoreStuffInMem(void)
|
||||||
{
|
{
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
for (int i = 0; i < NUMPLAYERS; i++)
|
||||||
|
nHandleOfPlayerPed[i] = CPools::GetPedPool()->GetIndex(CWorld::Players[i].m_pPed);
|
||||||
|
#endif
|
||||||
CPools::GetVehiclePool()->Store(pBuf0, pBuf1);
|
CPools::GetVehiclePool()->Store(pBuf0, pBuf1);
|
||||||
CPools::GetPedPool()->Store(pBuf2, pBuf3);
|
CPools::GetPedPool()->Store(pBuf2, pBuf3);
|
||||||
CPools::GetObjectPool()->Store(pBuf4, pBuf5);
|
CPools::GetObjectPool()->Store(pBuf4, pBuf5);
|
||||||
@ -1116,8 +1123,8 @@ void CReplay::StoreStuffInMem(void)
|
|||||||
CPools::GetDummyPool()->Store(pBuf10, pBuf11);
|
CPools::GetDummyPool()->Store(pBuf10, pBuf11);
|
||||||
pWorld1 = new uint8[sizeof(CSector) * NUMSECTORS_X * NUMSECTORS_Y];
|
pWorld1 = new uint8[sizeof(CSector) * NUMSECTORS_X * NUMSECTORS_Y];
|
||||||
memcpy(pWorld1, CWorld::GetSector(0, 0), NUMSECTORS_X * NUMSECTORS_Y * sizeof(CSector));
|
memcpy(pWorld1, CWorld::GetSector(0, 0), NUMSECTORS_X * NUMSECTORS_Y * sizeof(CSector));
|
||||||
WorldPtrList = CWorld::GetMovingEntityList();
|
WorldPtrList = CWorld::GetMovingEntityList().first; // why
|
||||||
BigBuildingPtrList = CWorld::GetBigBuildingList(LEVEL_NONE);
|
BigBuildingPtrList = CWorld::GetBigBuildingList(LEVEL_NONE).first;
|
||||||
pPickups = new uint8[sizeof(CPickup) * NUMPICKUPS];
|
pPickups = new uint8[sizeof(CPickup) * NUMPICKUPS];
|
||||||
memcpy(pPickups, CPickups::aPickUps, NUMPICKUPS * sizeof(CPickup));
|
memcpy(pPickups, CPickups::aPickUps, NUMPICKUPS * sizeof(CPickup));
|
||||||
pReferences = new uint8[(sizeof(CReference) * NUMREFERENCES)];
|
pReferences = new uint8[(sizeof(CReference) * NUMREFERENCES)];
|
||||||
@ -1162,8 +1169,8 @@ void CReplay::RestoreStuffFromMem(void)
|
|||||||
memcpy(CWorld::GetSector(0, 0), pWorld1, sizeof(CSector) * NUMSECTORS_X * NUMSECTORS_Y);
|
memcpy(CWorld::GetSector(0, 0), pWorld1, sizeof(CSector) * NUMSECTORS_X * NUMSECTORS_Y);
|
||||||
delete[] pWorld1;
|
delete[] pWorld1;
|
||||||
pWorld1 = nil;
|
pWorld1 = nil;
|
||||||
CWorld::GetMovingEntityList() = WorldPtrList;
|
CWorld::GetMovingEntityList().first = WorldPtrList;
|
||||||
CWorld::GetBigBuildingList(LEVEL_NONE) = BigBuildingPtrList;
|
CWorld::GetBigBuildingList(LEVEL_NONE).first = BigBuildingPtrList;
|
||||||
memcpy(CPickups::aPickUps, pPickups, sizeof(CPickup) * NUMPICKUPS);
|
memcpy(CPickups::aPickUps, pPickups, sizeof(CPickup) * NUMPICKUPS);
|
||||||
delete[] pPickups;
|
delete[] pPickups;
|
||||||
pPickups = nil;
|
pPickups = nil;
|
||||||
@ -1178,6 +1185,14 @@ void CReplay::RestoreStuffFromMem(void)
|
|||||||
memcpy(CRadar::ms_RadarTrace, pRadarBlips, sizeof(sRadarTrace) * NUMRADARBLIPS);
|
memcpy(CRadar::ms_RadarTrace, pRadarBlips, sizeof(sRadarTrace) * NUMRADARBLIPS);
|
||||||
delete[] pRadarBlips;
|
delete[] pRadarBlips;
|
||||||
pRadarBlips = nil;
|
pRadarBlips = nil;
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
for (int i = 0; i < NUMPLAYERS; i++) {
|
||||||
|
CPlayerPed* pPlayerPed = (CPlayerPed*)CPools::GetPedPool()->GetAt(nHandleOfPlayerPed[i]);
|
||||||
|
assert(pPlayerPed);
|
||||||
|
CWorld::Players[i].m_pPed = pPlayerPed;
|
||||||
|
pPlayerPed->RegisterReference((CEntity**)&CWorld::Players[i].m_pPed);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
FindPlayerPed()->m_pWanted = new CWanted(PlayerWanted);
|
FindPlayerPed()->m_pWanted = new CWanted(PlayerWanted);
|
||||||
CWorld::Players[0] = PlayerInfo;
|
CWorld::Players[0] = PlayerInfo;
|
||||||
int i = CPools::GetPedPool()->GetSize();
|
int i = CPools::GetPedPool()->GetSize();
|
||||||
@ -1394,7 +1409,7 @@ void CReplay::SaveReplayToHD(void)
|
|||||||
if (BufferStatus[first] == REPLAYBUFFER_RECORD || BufferStatus[first] == REPLAYBUFFER_PLAYBACK)
|
if (BufferStatus[first] == REPLAYBUFFER_RECORD || BufferStatus[first] == REPLAYBUFFER_PLAYBACK)
|
||||||
break;
|
break;
|
||||||
for(int i = first; ; i = (i + 1) % NUM_REPLAYBUFFERS){
|
for(int i = first; ; i = (i + 1) % NUM_REPLAYBUFFERS){
|
||||||
CFileMgr::Write(fw, (char*)Buffers[first], sizeof(Buffers[first]));
|
CFileMgr::Write(fw, (char*)Buffers[i], sizeof(Buffers[i]));
|
||||||
if (BufferStatus[i] == REPLAYBUFFER_RECORD)
|
if (BufferStatus[i] == REPLAYBUFFER_RECORD)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -234,8 +234,8 @@ private:
|
|||||||
static uint32 SlowMotion;
|
static uint32 SlowMotion;
|
||||||
static uint32 FramesActiveLookAroundCam;
|
static uint32 FramesActiveLookAroundCam;
|
||||||
static bool bDoLoadSceneWhenDone;
|
static bool bDoLoadSceneWhenDone;
|
||||||
static CPtrList WorldPtrList;
|
static CPtrNode* WorldPtrList;
|
||||||
static CPtrList BigBuildingPtrList;
|
static CPtrNode* BigBuildingPtrList;
|
||||||
static CWanted PlayerWanted;
|
static CWanted PlayerWanted;
|
||||||
static CPlayerInfo PlayerInfo;
|
static CPlayerInfo PlayerInfo;
|
||||||
static uint32 Time1;
|
static uint32 Time1;
|
||||||
@ -267,6 +267,9 @@ private:
|
|||||||
static float fDistanceLookAroundCam;
|
static float fDistanceLookAroundCam;
|
||||||
static float fAlphaAngleLookAroundCam;
|
static float fAlphaAngleLookAroundCam;
|
||||||
static float fBetaAngleLookAroundCam;
|
static float fBetaAngleLookAroundCam;
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
static int nHandleOfPlayerPed[NUMPLAYERS];
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void Init(void);
|
static void Init(void);
|
||||||
|
@ -2490,6 +2490,10 @@ CCamera::TryToStartNewCamMode(int obbeMode)
|
|||||||
TakeControl(FindPlayerEntity(), CCam::MODE_CAM_ON_A_STRING, JUMP_CUT, CAMCONTROL_OBBE);
|
TakeControl(FindPlayerEntity(), CCam::MODE_CAM_ON_A_STRING, JUMP_CUT, CAMCONTROL_OBBE);
|
||||||
return true;
|
return true;
|
||||||
case OBBE_COPCAR:
|
case OBBE_COPCAR:
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
if (CReplay::IsPlayingBack())
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
if(FindPlayerPed()->m_pWanted->m_nWantedLevel < 1)
|
if(FindPlayerPed()->m_pWanted->m_nWantedLevel < 1)
|
||||||
return false;
|
return false;
|
||||||
if(FindPlayerVehicle() == nil)
|
if(FindPlayerVehicle() == nil)
|
||||||
@ -2514,6 +2518,10 @@ CCamera::TryToStartNewCamMode(int obbeMode)
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
case OBBE_COPCAR_WHEEL:
|
case OBBE_COPCAR_WHEEL:
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
if (CReplay::IsPlayingBack())
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
if(FindPlayerPed()->m_pWanted->m_nWantedLevel < 1)
|
if(FindPlayerPed()->m_pWanted->m_nWantedLevel < 1)
|
||||||
return false;
|
return false;
|
||||||
if(FindPlayerVehicle() == nil)
|
if(FindPlayerVehicle() == nil)
|
||||||
|
@ -41,6 +41,10 @@ CPlayerInfo::SetPlayerSkin(char *skin)
|
|||||||
CVector&
|
CVector&
|
||||||
CPlayerInfo::GetPos()
|
CPlayerInfo::GetPos()
|
||||||
{
|
{
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
if (!m_pPed)
|
||||||
|
return TheCamera.GetPosition();
|
||||||
|
#endif
|
||||||
if (m_pPed->InVehicle())
|
if (m_pPed->InVehicle())
|
||||||
return m_pPed->m_pMyVehicle->GetPosition();
|
return m_pPed->m_pMyVehicle->GetPosition();
|
||||||
return m_pPed->GetPosition();
|
return m_pPed->GetPosition();
|
||||||
@ -342,6 +346,10 @@ CPlayerInfo::FindClosestCarSectorList(CPtrList& carList, CPed* ped, float unk1,
|
|||||||
void
|
void
|
||||||
CPlayerInfo::Process(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.
|
// Unused taxi feature. Gives you a dollar for every second with a passenger. Can be toggled via 0x29A opcode.
|
||||||
bool startTaxiTimer = true;
|
bool startTaxiTimer = true;
|
||||||
if (m_bUnusedTaxiThing && m_pPed->bInVehicle) {
|
if (m_bUnusedTaxiThing && m_pPed->bInVehicle) {
|
||||||
|
@ -26,8 +26,17 @@ CReferences::RemoveReferencesToPlayer(void)
|
|||||||
{
|
{
|
||||||
if(FindPlayerVehicle())
|
if(FindPlayerVehicle())
|
||||||
FindPlayerVehicle()->ResolveReferences();
|
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())
|
if(FindPlayerPed())
|
||||||
FindPlayerPed()->ResolveReferences();
|
FindPlayerPed()->ResolveReferences();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
#include "CutsceneMgr.h"
|
#include "CutsceneMgr.h"
|
||||||
#include "CdStream.h"
|
#include "CdStream.h"
|
||||||
#include "Streaming.h"
|
#include "Streaming.h"
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
#include "Replay.h"
|
||||||
|
#endif
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
bool CStreaming::ms_disableStreaming;
|
bool CStreaming::ms_disableStreaming;
|
||||||
@ -280,7 +283,11 @@ CStreaming::Update(void)
|
|||||||
!requestedSubway &&
|
!requestedSubway &&
|
||||||
!CGame::playingIntro &&
|
!CGame::playingIntro &&
|
||||||
ms_numModelsRequested < 5 &&
|
ms_numModelsRequested < 5 &&
|
||||||
!CRenderer::m_loadingPriority){
|
!CRenderer::m_loadingPriority
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
&& !CReplay::IsPlayingBack()
|
||||||
|
#endif
|
||||||
|
){
|
||||||
StreamVehiclesAndPeds();
|
StreamVehiclesAndPeds();
|
||||||
StreamZoneModels(FindPlayerCoors());
|
StreamZoneModels(FindPlayerCoors());
|
||||||
}
|
}
|
||||||
@ -1248,7 +1255,11 @@ CStreaming::StreamVehiclesAndPeds(void)
|
|||||||
static int modelQualityClass = 0;
|
static int modelQualityClass = 0;
|
||||||
|
|
||||||
if(CRecordDataForGame::IsRecording() ||
|
if(CRecordDataForGame::IsRecording() ||
|
||||||
CRecordDataForGame::IsPlayingBack())
|
CRecordDataForGame::IsPlayingBack()
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
|| CReplay::IsPlayingBack()
|
||||||
|
#endif
|
||||||
|
)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(FindPlayerPed()->m_pWanted->AreSwatRequired()){
|
if(FindPlayerPed()->m_pWanted->AreSwatRequired()){
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "Hud.h"
|
#include "Hud.h"
|
||||||
#include "PlayerPed.h"
|
#include "PlayerPed.h"
|
||||||
|
#include "Replay.h"
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
#include "User.h"
|
#include "User.h"
|
||||||
#include "Vehicle.h"
|
#include "Vehicle.h"
|
||||||
@ -115,6 +116,10 @@ CUserDisplay::Init()
|
|||||||
void
|
void
|
||||||
CUserDisplay::Process()
|
CUserDisplay::Process()
|
||||||
{
|
{
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
if (CReplay::IsPlayingBack())
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
PlaceName.Process();
|
PlaceName.Process();
|
||||||
OnscnTimer.Process();
|
OnscnTimer.Process();
|
||||||
Pager.Process();
|
Pager.Process();
|
||||||
|
@ -1386,6 +1386,10 @@ FindPlayerEntity(void)
|
|||||||
CVector
|
CVector
|
||||||
FindPlayerCoors(void)
|
FindPlayerCoors(void)
|
||||||
{
|
{
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
if (CReplay::IsPlayingBack())
|
||||||
|
return TheCamera.GetPosition();
|
||||||
|
#endif
|
||||||
CPlayerPed *ped = FindPlayerPed();
|
CPlayerPed *ped = FindPlayerPed();
|
||||||
if(ped->InVehicle())
|
if(ped->InVehicle())
|
||||||
return ped->m_pMyVehicle->GetPosition();
|
return ped->m_pMyVehicle->GetPosition();
|
||||||
@ -1396,6 +1400,11 @@ FindPlayerCoors(void)
|
|||||||
CVector &
|
CVector &
|
||||||
FindPlayerSpeed(void)
|
FindPlayerSpeed(void)
|
||||||
{
|
{
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
static CVector vecTmpVector(0.0f, 0.0f, 0.0f);
|
||||||
|
if (CReplay::IsPlayingBack())
|
||||||
|
return vecTmpVector;
|
||||||
|
#endif
|
||||||
CPlayerPed *ped = FindPlayerPed();
|
CPlayerPed *ped = FindPlayerPed();
|
||||||
if(ped->InVehicle())
|
if(ped->InVehicle())
|
||||||
return ped->m_pMyVehicle->m_vecMoveSpeed;
|
return ped->m_pMyVehicle->m_vecMoveSpeed;
|
||||||
@ -1406,6 +1415,9 @@ FindPlayerSpeed(void)
|
|||||||
CVector &
|
CVector &
|
||||||
FindPlayerCentreOfWorld(int32 player)
|
FindPlayerCentreOfWorld(int32 player)
|
||||||
{
|
{
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
if(CReplay::IsPlayingBack()) return TheCamera.GetPosition();
|
||||||
|
#endif
|
||||||
if(CCarCtrl::bCarsGeneratedAroundCamera) return TheCamera.GetPosition();
|
if(CCarCtrl::bCarsGeneratedAroundCamera) return TheCamera.GetPosition();
|
||||||
if(CWorld::Players[player].m_pRemoteVehicle) return CWorld::Players[player].m_pRemoteVehicle->GetPosition();
|
if(CWorld::Players[player].m_pRemoteVehicle) return CWorld::Players[player].m_pRemoteVehicle->GetPosition();
|
||||||
if(FindPlayerVehicle()) return FindPlayerVehicle()->GetPosition();
|
if(FindPlayerVehicle()) return FindPlayerVehicle()->GetPosition();
|
||||||
@ -1415,6 +1427,9 @@ FindPlayerCentreOfWorld(int32 player)
|
|||||||
CVector &
|
CVector &
|
||||||
FindPlayerCentreOfWorld_NoSniperShift(void)
|
FindPlayerCentreOfWorld_NoSniperShift(void)
|
||||||
{
|
{
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
if (CReplay::IsPlayingBack()) return TheCamera.GetPosition();
|
||||||
|
#endif
|
||||||
if(CCarCtrl::bCarsGeneratedAroundCamera) return TheCamera.GetPosition();
|
if(CCarCtrl::bCarsGeneratedAroundCamera) return TheCamera.GetPosition();
|
||||||
if(CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle)
|
if(CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle)
|
||||||
return CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle->GetPosition();
|
return CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle->GetPosition();
|
||||||
|
@ -135,6 +135,7 @@ CPlayerPed::SetupPlayerPed(int32 index)
|
|||||||
{
|
{
|
||||||
CPlayerPed *player = new CPlayerPed();
|
CPlayerPed *player = new CPlayerPed();
|
||||||
CWorld::Players[index].m_pPed = player;
|
CWorld::Players[index].m_pPed = player;
|
||||||
|
player->RegisterReference((CEntity**)&CWorld::Players[index].m_pPed);
|
||||||
|
|
||||||
player->SetOrientation(0.0f, 0.0f, 0.0f);
|
player->SetOrientation(0.0f, 0.0f, 0.0f);
|
||||||
|
|
||||||
|
@ -13,6 +13,9 @@
|
|||||||
#include "Weather.h"
|
#include "Weather.h"
|
||||||
#include "ModelIndices.h"
|
#include "ModelIndices.h"
|
||||||
#include "RenderBuffer.h"
|
#include "RenderBuffer.h"
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
#include "Replay.h"
|
||||||
|
#endif
|
||||||
#include "PointLights.h"
|
#include "PointLights.h"
|
||||||
#include "SpecialFX.h"
|
#include "SpecialFX.h"
|
||||||
#include "Shadows.h"
|
#include "Shadows.h"
|
||||||
@ -1609,6 +1612,10 @@ CShadows::CalcPedShadowValues(CVector vecLightDir,
|
|||||||
void
|
void
|
||||||
CShadows::RenderExtraPlayerShadows(void)
|
CShadows::RenderExtraPlayerShadows(void)
|
||||||
{
|
{
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
if (CReplay::IsPlayingBack())
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
if ( CTimeCycle::GetLightShadowStrength() != 0 )
|
if ( CTimeCycle::GetLightShadowStrength() != 0 )
|
||||||
{
|
{
|
||||||
CVehicle *pCar = FindPlayerVehicle();
|
CVehicle *pCar = FindPlayerVehicle();
|
||||||
|
@ -24,6 +24,9 @@
|
|||||||
#include "Object.h"
|
#include "Object.h"
|
||||||
#include "HandlingMgr.h"
|
#include "HandlingMgr.h"
|
||||||
#include "Heli.h"
|
#include "Heli.h"
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
#include "Replay.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@ -462,7 +465,10 @@ CHeli::ProcessControl(void)
|
|||||||
DMAudio.PlayOneShot(m_audioEntityId, SOUND_PED_HELI_PLAYER_FOUND, 0.0f);
|
DMAudio.PlayOneShot(m_audioEntityId, SOUND_PED_HELI_PLAYER_FOUND, 0.0f);
|
||||||
m_nPoliceShoutTimer = CTimer::GetTimeInMilliseconds() + 4500 + (CGeneral::GetRandomNumber() & 0xFFF);
|
m_nPoliceShoutTimer = CTimer::GetTimeInMilliseconds() + 4500 + (CGeneral::GetRandomNumber() & 0xFFF);
|
||||||
}
|
}
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
if (!CReplay::IsPlayingBack())
|
||||||
|
#endif
|
||||||
|
{
|
||||||
// Shoot
|
// Shoot
|
||||||
int shootTimeout;
|
int shootTimeout;
|
||||||
if (m_heliType == HELI_TYPE_RANDOM) {
|
if (m_heliType == HELI_TYPE_RANDOM) {
|
||||||
@ -477,7 +483,8 @@ CHeli::ProcessControl(void)
|
|||||||
}
|
}
|
||||||
if (CCullZones::NoPolice())
|
if (CCullZones::NoPolice())
|
||||||
shootTimeout /= 2;
|
shootTimeout /= 2;
|
||||||
}else
|
}
|
||||||
|
else
|
||||||
shootTimeout = 1500;
|
shootTimeout = 1500;
|
||||||
|
|
||||||
if (FindPlayerPed()->m_pWanted->IsIgnored())
|
if (FindPlayerPed()->m_pWanted->IsIgnored())
|
||||||
@ -489,7 +496,8 @@ CHeli::ProcessControl(void)
|
|||||||
if (CWorld::GetIsLineOfSightClear(GetPosition(), FindPlayerCoors(), true, false, false, false, false, false)) {
|
if (CWorld::GetIsLineOfSightClear(GetPosition(), FindPlayerCoors(), true, false, false, false, false, false)) {
|
||||||
if (m_heliStatus == HELI_STATUS_HOVER2)
|
if (m_heliStatus == HELI_STATUS_HOVER2)
|
||||||
m_heliStatus = HELI_STATUS_HOVER;
|
m_heliStatus = HELI_STATUS_HOVER;
|
||||||
}else{
|
}
|
||||||
|
else {
|
||||||
m_nShootTimer = CTimer::GetTimeInMilliseconds();
|
m_nShootTimer = CTimer::GetTimeInMilliseconds();
|
||||||
if (m_heliStatus == HELI_STATUS_HOVER)
|
if (m_heliStatus == HELI_STATUS_HOVER)
|
||||||
m_heliStatus = HELI_STATUS_HOVER2;
|
m_heliStatus = HELI_STATUS_HOVER2;
|
||||||
@ -514,6 +522,7 @@ CHeli::ProcessControl(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Drop Catalina's bombs
|
// Drop Catalina's bombs
|
||||||
if(m_heliType == HELI_TYPE_CATALINA && m_pathState > 8 && (CTimer::GetTimeInMilliseconds()>>9) != (CTimer::GetPreviousTimeInMilliseconds()>>9)){
|
if(m_heliType == HELI_TYPE_CATALINA && m_pathState > 8 && (CTimer::GetTimeInMilliseconds()>>9) != (CTimer::GetPreviousTimeInMilliseconds()>>9)){
|
||||||
@ -825,7 +834,11 @@ CHeli::UpdateHelis(void)
|
|||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
// Spawn new police helis
|
// Spawn new police helis
|
||||||
int numHelisRequired = FindPlayerPed()->m_pWanted->NumOfHelisRequired();
|
int numHelisRequired =
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
CReplay::IsPlayingBack() ? 0 :
|
||||||
|
#endif
|
||||||
|
FindPlayerPed()->m_pWanted->NumOfHelisRequired();
|
||||||
if(CStreaming::HasModelLoaded(MI_CHOPPER) && CTimer::GetTimeInMilliseconds() > TestForNewRandomHelisTimer){
|
if(CStreaming::HasModelLoaded(MI_CHOPPER) && CTimer::GetTimeInMilliseconds() > TestForNewRandomHelisTimer){
|
||||||
// Spawn a police heli
|
// Spawn a police heli
|
||||||
TestForNewRandomHelisTimer = CTimer::GetTimeInMilliseconds() + 15000;
|
TestForNewRandomHelisTimer = CTimer::GetTimeInMilliseconds() + 15000;
|
||||||
|
Loading…
Reference in New Issue
Block a user