mirror of
https://git.rip/DMCA_FUCKER/re3.git
synced 2024-12-23 20:00:01 +00:00
Merge remote-tracking branch 'upstream/miami' into miami
This commit is contained in:
commit
bb2e601e13
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
sdk/* linguist-vendored
|
||||
vendor/* linguist-vendored
|
|
@ -88,7 +88,7 @@ cMusicManager::ResetMusicAfterReload()
|
|||
field_3995 = false;
|
||||
field_3996 = false;
|
||||
field_3997 = false;
|
||||
field_3998 = -1;
|
||||
nFramesSinceCutsceneEnded = -1;
|
||||
field_3999 = false;
|
||||
field_399A = false;
|
||||
field_399C = false;
|
||||
|
@ -195,7 +195,7 @@ cMusicManager::Initialise()
|
|||
field_3995 = false;
|
||||
field_3996 = false;
|
||||
field_3997 = false;
|
||||
field_3998 = -1;
|
||||
nFramesSinceCutsceneEnded = -1;
|
||||
field_3999 = false;
|
||||
field_399A = false;
|
||||
m_nMusicModeToBeSet = MUSICMODE_DISABLED;
|
||||
|
@ -507,7 +507,7 @@ cMusicManager::ServiceGameMode()
|
|||
}
|
||||
|
||||
if (!field_3996) {
|
||||
field_3998 = -1;
|
||||
nFramesSinceCutsceneEnded = -1;
|
||||
gNumRetunePresses = 0;
|
||||
gRetuneCounter = 0;
|
||||
field_2 = false;
|
||||
|
@ -867,7 +867,7 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
|
|||
{
|
||||
static bool bRadioStatsRecorded = false;
|
||||
static bool bRadioStatsRecorded2 = false;
|
||||
uint8 AmbienceVol;
|
||||
uint8 volume;
|
||||
if (!field_398F)
|
||||
m_nStreamedTrack = m_nFrontendTrack;
|
||||
if (gRetuneCounter != 0 || field_2) {
|
||||
|
@ -920,8 +920,8 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
|
|||
}
|
||||
else
|
||||
{
|
||||
ComputeAmbienceVol(true, AmbienceVol);
|
||||
SampleManager.SetStreamedVolumeAndPan(AmbienceVol, 63, 1, 0);
|
||||
ComputeAmbienceVol(true, volume);
|
||||
SampleManager.SetStreamedVolumeAndPan(volume, 63, 1, 0);
|
||||
}
|
||||
if (m_nStreamedTrack < STREAMED_SOUND_CITY_AMBIENT)
|
||||
m_nLastTrackServiceTime = CTimer::GetTimeInMillisecondsPauseMode();
|
||||
|
@ -952,8 +952,8 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
|
|||
|
||||
if (m_nPlayingTrack >= STREAMED_SOUND_CITY_AMBIENT && m_nPlayingTrack <= STREAMED_SOUND_AMBSIL_AMBIENT)
|
||||
{
|
||||
ComputeAmbienceVol(false, AmbienceVol);
|
||||
SampleManager.SetStreamedVolumeAndPan(AmbienceVol, 63, 1, 0);
|
||||
ComputeAmbienceVol(false, volume);
|
||||
SampleManager.SetStreamedVolumeAndPan(volume, 63, 1, 0);
|
||||
return;
|
||||
}
|
||||
if (CTimer::GetIsSlowMotionActive())
|
||||
|
@ -967,57 +967,51 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
|
|||
}
|
||||
else if (DistToTargetSq >= SQR(10.0f))
|
||||
{
|
||||
AmbienceVol = (45.0f - (Sqrt(DistToTargetSq) - 10.0f)) / 45.0f * m_nCurrentVolume;
|
||||
volume = (45.0f - (Sqrt(DistToTargetSq) - 10.0f)) / 45.0f * m_nCurrentVolume;
|
||||
if (AudioManager.ShouldDuckMissionAudio(0) || AudioManager.ShouldDuckMissionAudio(1))
|
||||
AmbienceVol /= 4;
|
||||
volume /= 4;
|
||||
|
||||
uint8 pan = 0;
|
||||
if (AmbienceVol > 0)
|
||||
if (volume > 0)
|
||||
{
|
||||
CVector panVec;
|
||||
AudioManager.TranslateEntity(&TheCamera.pTargetEntity->GetPosition(), &panVec);
|
||||
pan = AudioManager.ComputePan(55.0f, &panVec);
|
||||
}
|
||||
if (gRetuneCounter != 0)
|
||||
AmbienceVol = 0;
|
||||
SampleManager.SetStreamedVolumeAndPan(AmbienceVol, pan, 0, 0);
|
||||
}
|
||||
else if (!AudioManager.ShouldDuckMissionAudio(0) && !AudioManager.ShouldDuckMissionAudio(1))
|
||||
{
|
||||
if (gRetuneCounter == 0)
|
||||
SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, 0, 0);
|
||||
else
|
||||
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
|
||||
volume = 0;
|
||||
SampleManager.SetStreamedVolumeAndPan(volume, pan, 0, 0);
|
||||
}
|
||||
else if (AudioManager.ShouldDuckMissionAudio(0) || AudioManager.ShouldDuckMissionAudio(1))
|
||||
SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, 0, 0);
|
||||
else if (gRetuneCounter != 0)
|
||||
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
|
||||
else
|
||||
SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!AudioManager.ShouldDuckMissionAudio(0) && !AudioManager.ShouldDuckMissionAudio(1)) {
|
||||
if (field_3998 == -1)
|
||||
AmbienceVol = m_nCurrentVolume;
|
||||
else if (field_3998 < 20)
|
||||
{
|
||||
AmbienceVol = Min(m_nCurrentVolume, 25);
|
||||
field_3998++;
|
||||
}
|
||||
else if (field_3998 < 40)
|
||||
{
|
||||
AmbienceVol = Min(m_nCurrentVolume, 3 * (field_3998 - 20) + 25);
|
||||
field_3998++;
|
||||
}
|
||||
else
|
||||
{
|
||||
AmbienceVol = m_nCurrentVolume;
|
||||
field_3998 = -1;
|
||||
}
|
||||
if (gRetuneCounter != 0)
|
||||
AmbienceVol = 0;
|
||||
SampleManager.SetStreamedVolumeAndPan(AmbienceVol, 63, 0, 0);
|
||||
} else
|
||||
SampleManager.SetStreamedVolumeAndPan(Min(m_nCurrentVolume, 25), 63, 0, 0);
|
||||
} else if (AudioManager.ShouldDuckMissionAudio(0) || AudioManager.ShouldDuckMissionAudio(1)) {
|
||||
SampleManager.SetStreamedVolumeAndPan(Min(m_nCurrentVolume, 25), 63, 0, 0);
|
||||
} else {
|
||||
if (nFramesSinceCutsceneEnded == -1)
|
||||
volume = m_nCurrentVolume;
|
||||
else if (nFramesSinceCutsceneEnded < 20)
|
||||
{
|
||||
volume = Min(m_nCurrentVolume, 25);
|
||||
nFramesSinceCutsceneEnded++;
|
||||
}
|
||||
else if (nFramesSinceCutsceneEnded < 40)
|
||||
{
|
||||
volume = Min(m_nCurrentVolume, 3 * (nFramesSinceCutsceneEnded - 20) + 25);
|
||||
nFramesSinceCutsceneEnded++;
|
||||
}
|
||||
else
|
||||
{
|
||||
volume = m_nCurrentVolume;
|
||||
nFramesSinceCutsceneEnded = -1;
|
||||
}
|
||||
if (gRetuneCounter != 0)
|
||||
volume = 0;
|
||||
SampleManager.SetStreamedVolumeAndPan(volume, 63, 0, 0);
|
||||
}
|
||||
if (m_nVolumeLatency > 0)
|
||||
m_nVolumeLatency--;
|
||||
|
@ -1115,7 +1109,8 @@ cMusicManager::GetListenTimeArray()
|
|||
return aListenTimeArray;
|
||||
}
|
||||
|
||||
uint32 cMusicManager::GetTrackStartPos(uint32 track)
|
||||
uint32
|
||||
cMusicManager::GetTrackStartPos(uint32 track)
|
||||
{
|
||||
if (!IsInitialised()) return 0;
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
bool field_3995;
|
||||
bool field_3996;
|
||||
bool field_3997;
|
||||
int8 field_3998;
|
||||
int8 nFramesSinceCutsceneEnded;
|
||||
bool field_3999;
|
||||
bool field_399A;
|
||||
uint8 m_nMusicModeToBeSet;
|
||||
|
@ -110,4 +110,4 @@ VALIDATE_SIZE(cMusicManager, 0x95C);
|
|||
|
||||
extern cMusicManager MusicManager;
|
||||
extern bool g_bAnnouncementReadPosAlready; // we have a symbol of this so it was declared in .h
|
||||
float GetHeightScale();
|
||||
float GetHeightScale();
|
||||
|
|
|
@ -2239,7 +2239,6 @@ void CTheScripts::Init()
|
|||
StoreVehicleWasRandom = true;
|
||||
OnAMissionFlag = 0;
|
||||
LastMissionPassedTime = (uint32)-1;
|
||||
NextFreeCollectiveIndex = 0;
|
||||
LastRandomPedId = -1;
|
||||
for (int i = 0; i < MAX_NUM_USED_OBJECTS; i++){
|
||||
memset(&UsedObjectArray[i].name, 0, sizeof(UsedObjectArray[i].name));
|
||||
|
@ -16138,7 +16137,7 @@ void CTheScripts::ReadMultiScriptFileOffsetsFromScript()
|
|||
MainScriptSize = Read4BytesFromScript(&ip);
|
||||
LargestMissionScriptSize = Read4BytesFromScript(&ip);
|
||||
NumberOfMissionScripts = Read2BytesFromScript(&ip);
|
||||
ip += 2;
|
||||
NumberOfExclusiveMissionScripts = Read2BytesFromScript(&ip);
|
||||
for (int i = 0; i < NumberOfMissionScripts; i++) {
|
||||
MultiScriptArray[i] = Read4BytesFromScript(&ip);
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ struct intro_script_rectangle
|
|||
VALIDATE_SIZE(intro_script_rectangle, 0x18);
|
||||
|
||||
enum {
|
||||
SCRIPT_TEXT_MAX_LENGTH = 500
|
||||
SCRIPT_TEXT_MAX_LENGTH = 100
|
||||
};
|
||||
|
||||
struct intro_text_line
|
||||
|
@ -227,7 +227,11 @@ enum {
|
|||
};
|
||||
|
||||
enum {
|
||||
#ifdef PS2
|
||||
SIZE_MAIN_SCRIPT = 205512,
|
||||
#else
|
||||
SIZE_MAIN_SCRIPT = 225512,
|
||||
#endif
|
||||
SIZE_MISSION_SCRIPT = 35000,
|
||||
SIZE_SCRIPT_SPACE = SIZE_MAIN_SCRIPT + SIZE_MISSION_SCRIPT
|
||||
};
|
||||
|
|
|
@ -89,6 +89,10 @@ bool CPad::IsAffectedByController = false;
|
|||
_TODO("gbFastTime");
|
||||
extern bool gbFastTime;
|
||||
|
||||
#ifdef WALLCLIMB_CHEAT
|
||||
extern bool gGravityCheat;
|
||||
#endif
|
||||
|
||||
void WeaponCheat1()
|
||||
{
|
||||
CHud::SetHelpMessage(TheText.Get("CHEAT2"), true);
|
||||
|
@ -554,6 +558,22 @@ void AltDodoCheat(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef WALLCLIMB_CHEAT
|
||||
void WallClimbingCheat(void)
|
||||
{
|
||||
wchar* string;
|
||||
if (gGravityCheat) {
|
||||
string = TheText.Get("CHEATOF");
|
||||
gGravityCheat = false;
|
||||
}
|
||||
else {
|
||||
string = TheText.Get("CHEAT1");
|
||||
gGravityCheat = true;
|
||||
}
|
||||
CHud::SetHelpMessage(string, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
void FlyingFishCheat(void)
|
||||
{
|
||||
CHud::SetHelpMessage(TheText.Get("CHEAT1"), true);
|
||||
|
@ -1430,6 +1450,12 @@ void CPad::AddToPCCheatString(char c)
|
|||
AltDodoCheat();
|
||||
#endif
|
||||
|
||||
#ifdef WALLCLIMB_CHEAT
|
||||
// "SPIDERCAR"
|
||||
if (!_CHEATCMP("RACREDIPS"))
|
||||
WallClimbingCheat();
|
||||
#endif
|
||||
|
||||
#if !defined(PC_WATER) && defined(WATER_CHEATS)
|
||||
// SEABEDCHEAT
|
||||
if (!_CHEATCMP("TAEHCDEBAESON"))
|
||||
|
|
|
@ -252,6 +252,7 @@ enum Config {
|
|||
#define KANGAROO_CHEAT
|
||||
#define ALLCARSHELI_CHEAT
|
||||
#define ALT_DODO_CHEAT
|
||||
#define WALLCLIMB_CHEAT
|
||||
#define REGISTER_START_BUTTON
|
||||
//#define BIND_VEHICLE_FIREWEAPON // Adds ability to rebind fire key for 'in vehicle' controls
|
||||
|
||||
|
|
|
@ -740,12 +740,14 @@ DisplayGameDebugText()
|
|||
static bool bDisplayRate = false;
|
||||
static bool bDisplayCheatStr = false;
|
||||
|
||||
#ifndef FINAL
|
||||
{
|
||||
SETTWEAKPATH("GameDebugText");
|
||||
TWEAKBOOL(bDisplayPosn);
|
||||
TWEAKBOOL(bDisplayRate);
|
||||
TWEAKBOOL(bDisplayCheatStr);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
char str[200];
|
||||
|
@ -1091,6 +1093,7 @@ Idle(void *arg)
|
|||
#endif
|
||||
|
||||
#ifdef FIX_BUGS
|
||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)FALSE); // TODO: temp? this fixes OpenGL render but there should be a better place for this
|
||||
// This has to be done BEFORE RwCameraBeginUpdate
|
||||
RwCameraSetFarClipPlane(Scene.camera, CTimeCycle::GetFarClip());
|
||||
RwCameraSetFogDistance(Scene.camera, CTimeCycle::GetFogStart());
|
||||
|
|
|
@ -23,6 +23,11 @@
|
|||
|
||||
//--MIAMI: file done
|
||||
|
||||
#ifdef WALLCLIMB_CHEAT
|
||||
bool gGravityCheat;
|
||||
#endif
|
||||
|
||||
|
||||
CPhysical::CPhysical(void)
|
||||
{
|
||||
int i;
|
||||
|
@ -521,8 +526,29 @@ CPhysical::ApplySpringDampening(float damping, CVector &springDir, CVector &poin
|
|||
void
|
||||
CPhysical::ApplyGravity(void)
|
||||
{
|
||||
if(bAffectedByGravity)
|
||||
m_vecMoveSpeed.z -= GRAVITY * CTimer::GetTimeStep();
|
||||
if (!bAffectedByGravity)
|
||||
return;
|
||||
#ifdef WALLCLIMB_CHEAT
|
||||
if (gGravityCheat && this == FindPlayerVehicle()) {
|
||||
static CVector v1(0.0f, 0.0f, 1.0f), v2(0.0f, 0.0f, 1.0f);
|
||||
CVector prop = GetPosition() - (GetUp() + GetUp());
|
||||
CColPoint point;
|
||||
CEntity* entity;
|
||||
if (CWorld::ProcessLineOfSight(GetPosition(), prop, point, entity, true, false, false, false, false, false))
|
||||
v2 = point.normal;
|
||||
else
|
||||
v2 = CVector(0.0f, 0.0f, 1.0f);
|
||||
float coef = clamp(CTimer::GetTimeStep() * 0.5f, 0.05f, 0.8f);
|
||||
v1 = v1 * (1.0f - coef) + v2 * coef;
|
||||
if (v1.MagnitudeSqr() < 0.1f)
|
||||
v1 = CVector(0.0f, 0.0f, 1.0f);
|
||||
else
|
||||
v1.Normalise();
|
||||
m_vecMoveSpeed -= GRAVITY * CTimer::GetTimeStep() * v1;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
m_vecMoveSpeed.z -= GRAVITY * CTimer::GetTimeStep();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -351,6 +351,18 @@ enum
|
|||
MI_BLOODRA,
|
||||
MI_BLOODRB,
|
||||
MI_VICECHEE,
|
||||
// 3 available vehicle slots in here
|
||||
MI_LAST_VEHICLE = 239,
|
||||
|
||||
MI_CAR_DOOR = 240,
|
||||
MI_CAR_BUMPER,
|
||||
MI_CAR_PANEL,
|
||||
MI_CAR_BONNET,
|
||||
MI_CAR_BOOT,
|
||||
MI_CAR_WHEEL,
|
||||
MI_BODYPARTA,
|
||||
MI_BODYPARTB,
|
||||
|
||||
// HACK
|
||||
MI_TRAIN = -1,
|
||||
MI_DODO = -2,
|
||||
|
@ -398,15 +410,6 @@ enum
|
|||
MI_CUTOBJ04,
|
||||
MI_CUTOBJ05,
|
||||
|
||||
MI_CAR_DOOR = 240,
|
||||
MI_CAR_BUMPER,
|
||||
MI_CAR_PANEL,
|
||||
MI_CAR_BONNET,
|
||||
MI_CAR_BOOT,
|
||||
MI_CAR_WHEEL,
|
||||
MI_BODYPARTA,
|
||||
MI_BODYPARTB,
|
||||
|
||||
MI_AIRTRAIN_VLO = 257,
|
||||
MI_MOBILE = 258,
|
||||
|
||||
|
|
|
@ -12,13 +12,33 @@
|
|||
#include "Weather.h"
|
||||
#include "PedAttractor.h"
|
||||
#include "Object.h"
|
||||
#include "CarCtrl.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <float.h>
|
||||
#endif
|
||||
|
||||
// --MIAMI: Done
|
||||
CCivilianPed::CCivilianPed(ePedType pedtype, uint32 mi) : CPed(pedtype)
|
||||
{
|
||||
SetModelIndex(mi);
|
||||
for (int i = 0; i < ARRAY_SIZE(m_nearPeds); i++) {
|
||||
m_nearPeds[i] = nil;
|
||||
}
|
||||
m_bLookForVacantCars = false;
|
||||
if (pedtype == PEDTYPE_CRIMINAL)
|
||||
m_bLookForVacantCars = true;
|
||||
|
||||
m_nLookForVacantCarsCounter = 0;
|
||||
m_bJustStoleACar = false;
|
||||
m_bStealCarEvenIfThereIsSomeoneInIt = false;
|
||||
for (int i = 0; i < ARRAY_SIZE(m_nStealWishList); i++) {
|
||||
uint32 randomCarModel = CGeneral::GetRandomNumberInRange(MI_LANDSTAL, MI_LAST_VEHICLE + 1);
|
||||
if (CModelInfo::IsCarModel(randomCarModel) || CModelInfo::IsBikeModel(randomCarModel))
|
||||
m_nStealWishList[i] = randomCarModel;
|
||||
else
|
||||
m_nStealWishList[i] = MI_CHEETAH;
|
||||
}
|
||||
m_nAttractorCycleState = 0;
|
||||
m_bAttractorUnk = (CGeneral::GetRandomNumberInRange(0.0f, 1.0f) < 1.25f);
|
||||
}
|
||||
|
@ -384,7 +404,7 @@ CCivilianPed::ProcessControl(void)
|
|||
CivilianAI();
|
||||
|
||||
if (CharCreatedBy == RANDOM_CHAR) {
|
||||
// TODO(Miami): EnterVacantNearbyCars();
|
||||
EnterVacantNearbyCars();
|
||||
UseNearbyAttractors();
|
||||
}
|
||||
|
||||
|
@ -483,3 +503,83 @@ bool CCivilianPed::IsAttractedTo(int8 type)
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// --MIAMI: Done
|
||||
void
|
||||
CCivilianPed::EnterVacantNearbyCars(void)
|
||||
{
|
||||
if (!m_bLookForVacantCars)
|
||||
return;
|
||||
|
||||
if (m_bJustStoleACar && bInVehicle && m_carInObjective == m_pMyVehicle) {
|
||||
m_bJustStoleACar = false;
|
||||
m_pMyVehicle->SetStatus(STATUS_PHYSICS);
|
||||
m_pMyVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE;
|
||||
m_pMyVehicle->AutoPilot.m_nCruiseSpeed = 10;
|
||||
m_pMyVehicle->bEngineOn = true;
|
||||
|
||||
} else if (!bHasAlreadyStoleACar) {
|
||||
if (m_nLookForVacantCarsCounter == 8) {
|
||||
m_nLookForVacantCarsCounter = 0;
|
||||
if (IsPedInControl() && m_objective == OBJECTIVE_NONE) {
|
||||
|
||||
CVehicle *foundCar = nil;
|
||||
float closestDist = FLT_MAX;
|
||||
int minX = CWorld::GetSectorIndexX(GetPosition().x - 10.0f);
|
||||
if (minX < 0) minX = 0;
|
||||
int minY = CWorld::GetSectorIndexY(GetPosition().y - 10.0f);
|
||||
if (minY < 0) minY = 0;
|
||||
int maxX = CWorld::GetSectorIndexX(GetPosition().x + 10.0f);
|
||||
if (maxX > NUMSECTORS_X - 1) maxX = NUMSECTORS_X - 1;
|
||||
int maxY = CWorld::GetSectorIndexY(GetPosition().y + 10.0f);
|
||||
if (maxY > NUMSECTORS_Y - 1) maxY = NUMSECTORS_Y - 1;
|
||||
|
||||
for (int curY = minY; curY <= maxY; curY++) {
|
||||
for (int curX = minX; curX <= maxX; curX++) {
|
||||
CSector* sector = CWorld::GetSector(curX, curY);
|
||||
for (CPtrNode* node = sector->m_lists[ENTITYLIST_VEHICLES].first; node; node = node->next) {
|
||||
CVehicle* veh = (CVehicle*)node->item;
|
||||
if (veh && veh->IsCar()) {
|
||||
|
||||
// Looks like PARKED_VEHICLE condition isn't there in Mobile.
|
||||
if (veh->VehicleCreatedBy == RANDOM_VEHICLE || veh->VehicleCreatedBy == PARKED_VEHICLE) {
|
||||
if (IsOnStealWishList(veh->GetModelIndex()) && !veh->IsLawEnforcementVehicle()
|
||||
&& (m_bStealCarEvenIfThereIsSomeoneInIt || !veh->pDriver && !veh->m_nNumPassengers)
|
||||
&& !veh->m_nNumGettingIn && !veh->m_nGettingInFlags && !veh->m_nGettingOutFlags
|
||||
&& !veh->m_pCarFire && veh->m_fHealth > 800.0f
|
||||
&& !veh->IsUpsideDown() && !veh->IsOnItsSide() && veh->CanPedEnterCar()) {
|
||||
float dist = (GetPosition() - veh->GetPosition()).MagnitudeSqr();
|
||||
if (dist < sq(10.0f) && dist < closestDist && veh->IsClearToDriveAway()) {
|
||||
foundCar = veh;
|
||||
closestDist = dist;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (foundCar) {
|
||||
m_bJustStoleACar = true;
|
||||
bHasAlreadyStoleACar = true;
|
||||
CCarCtrl::JoinCarWithRoadSystem(foundCar);
|
||||
SetObjective(OBJECTIVE_ENTER_CAR_AS_DRIVER, foundCar);
|
||||
SetObjectiveTimer(10000);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
++m_nLookForVacantCarsCounter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
CCivilianPed::IsOnStealWishList(int32 model)
|
||||
{
|
||||
for (int i = 0; i < ARRAY_SIZE(m_nStealWishList); i++) {
|
||||
if (model == m_nStealWishList[i]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
|
@ -4,6 +4,11 @@
|
|||
|
||||
class CCivilianPed : public CPed
|
||||
{
|
||||
bool m_bLookForVacantCars;
|
||||
uint32 m_nLookForVacantCarsCounter;
|
||||
bool m_bStealCarEvenIfThereIsSomeoneInIt; // unused
|
||||
bool m_bJustStoleACar;
|
||||
uint32 m_nStealWishList[16];
|
||||
bool m_bAttractorUnk;
|
||||
int32 m_nAttractorCycleState;
|
||||
public:
|
||||
|
@ -15,6 +20,8 @@ public:
|
|||
void UseNearbyAttractors(void);
|
||||
void FindNearbyAttractorsSectorList(CPtrList&, float&, C2dEffect*&, CEntity*&);
|
||||
bool IsAttractedTo(int8);
|
||||
void EnterVacantNearbyCars(void);
|
||||
bool IsOnStealWishList(int32);
|
||||
};
|
||||
#ifndef PED_SKIN
|
||||
VALIDATE_SIZE(CCivilianPed, 0x53C);
|
||||
|
|
995
src/peds/Ped.cpp
995
src/peds/Ped.cpp
File diff suppressed because it is too large
Load diff
|
@ -458,7 +458,7 @@ public:
|
|||
uint32 bTurnedAroundOnAttractor : 1;
|
||||
|
||||
uint32 bHasAlreadyUsedAttractor : 1;
|
||||
uint32 b155_2 : 1;
|
||||
uint32 bHasAlreadyStoleACar : 1;
|
||||
uint32 bCarPassenger : 1;
|
||||
uint32 bFleeWhenStanding : 1;
|
||||
uint32 bGotUpOfMyOwnAccord : 1;
|
||||
|
@ -468,7 +468,7 @@ public:
|
|||
|
||||
uint32 bIsDrowning : 1;
|
||||
uint32 bDrownsInWater : 1;
|
||||
uint32 b156_4 : 1;
|
||||
uint32 bWaitForLeaderToComeCloser : 1;
|
||||
uint32 bHeldHostageInCar : 1;
|
||||
uint32 bIsPlayerFriend : 1;
|
||||
uint32 bHeadStuckInCollision : 1;
|
||||
|
@ -809,7 +809,6 @@ public:
|
|||
void GetNearestDoor(CVehicle*, CVector&);
|
||||
bool GetNearestPassengerDoor(CVehicle*, CVector&);
|
||||
int GetNextPointOnRoute(void);
|
||||
uint8 GetPedRadioCategory(uint32);
|
||||
int GetWeaponSlot(eWeaponType);
|
||||
bool CanWeRunAndFireWithWeapon(void);
|
||||
void GoToNearestDoor(CVehicle*);
|
||||
|
@ -966,6 +965,8 @@ public:
|
|||
void Dress(void);
|
||||
int32 KillCharOnFootMelee(CVector&, CVector&, CVector&);
|
||||
int32 KillCharOnFootArmed(CVector&, CVector&, CVector&);
|
||||
void SetLook(CEntity* to);
|
||||
void SetLook(float direction);
|
||||
|
||||
bool HasWeaponSlot(uint8 slot) { return m_weapons[slot].m_eWeaponType != WEAPONTYPE_UNARMED; }
|
||||
CWeapon& GetWeapon(uint8 slot) { return m_weapons[slot]; }
|
||||
|
|
|
@ -16,7 +16,7 @@ enum ePedType
|
|||
PEDTYPE_GANG4,
|
||||
PEDTYPE_GANG5,
|
||||
PEDTYPE_GANG6,
|
||||
PEDTYPE_GANG7,
|
||||
PEDTYPE_GANG7, // Vercetti gang
|
||||
PEDTYPE_GANG8,
|
||||
PEDTYPE_GANG9,
|
||||
PEDTYPE_EMERGENCY,
|
||||
|
|
|
@ -490,7 +490,11 @@ CCoronas::RenderReflections(void)
|
|||
int intensity = distanceFade*heightFade * 230.0 * CWeather::WetRoads;
|
||||
|
||||
CSprite::RenderBufferedOneXLUSprite(
|
||||
#ifdef FIX_BUGS
|
||||
spriteCoors.x, spriteCoors.y, spriteCoors.z,
|
||||
#else
|
||||
spriteCoors.x, spriteCoors.y, RwIm2DGetNearScreenZ(),
|
||||
#endif
|
||||
spritew * aCoronas[i].size * 0.75f,
|
||||
spriteh * aCoronas[i].size * 2.0f,
|
||||
(intensity * CCoronas::aCoronas[i].red)>>8,
|
||||
|
|
|
@ -1,5 +1,15 @@
|
|||
#if defined RW_GL3 && !defined LIBRW_SDL2
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <mmsystem.h>
|
||||
#include <shellapi.h>
|
||||
#include <windowsx.h>
|
||||
#include <basetsd.h>
|
||||
#include <regstr.h>
|
||||
#include <shlobj.h>
|
||||
#endif
|
||||
|
||||
#define WITHWINDOWS
|
||||
#include "common.h"
|
||||
|
||||
|
@ -1195,7 +1205,11 @@ void resizeCB(GLFWwindow* window, int width, int height) {
|
|||
* memory things don't work.
|
||||
*/
|
||||
/* redraw window */
|
||||
if (RwInitialised && (gGameState == GS_PLAYING_GAME || gGameState == GS_ANIMVIEWER))
|
||||
if (RwInitialised && (gGameState == GS_PLAYING_GAME
|
||||
#ifndef MASTER
|
||||
|| gGameState == GS_ANIMVIEWER
|
||||
#endif
|
||||
))
|
||||
{
|
||||
RsEventHandler((gGameState == GS_PLAYING_GAME ? rsIDLE : rsANIMVIEWER), (void*)TRUE);
|
||||
}
|
||||
|
@ -1625,6 +1639,72 @@ main(int argc, char *argv[])
|
|||
break;
|
||||
}
|
||||
|
||||
case GS_INIT_LOGO_MPEG:
|
||||
{
|
||||
//if (!startupDeactivate)
|
||||
// PlayMovieInWindow(cmdShow, "movies\\Logo.mpg");
|
||||
gGameState = GS_LOGO_MPEG;
|
||||
TRACE("gGameState = GS_LOGO_MPEG;");
|
||||
break;
|
||||
}
|
||||
|
||||
case GS_LOGO_MPEG:
|
||||
{
|
||||
// CPad::UpdatePads();
|
||||
|
||||
// if (startupDeactivate || ControlsManager.GetJoyButtonJustDown() != 0)
|
||||
++gGameState;
|
||||
// else if (CPad::GetPad(0)->GetLeftMouseJustDown())
|
||||
// ++gGameState;
|
||||
// else if (CPad::GetPad(0)->GetEnterJustDown())
|
||||
// ++gGameState;
|
||||
// else if (CPad::GetPad(0)->GetCharJustDown(' '))
|
||||
// ++gGameState;
|
||||
// else if (CPad::GetPad(0)->GetAltJustDown())
|
||||
// ++gGameState;
|
||||
// else if (CPad::GetPad(0)->GetTabJustDown())
|
||||
// ++gGameState;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case GS_INIT_INTRO_MPEG:
|
||||
{
|
||||
//#ifndef NO_MOVIES
|
||||
// CloseClip();
|
||||
// CoUninitialize();
|
||||
//#endif
|
||||
//
|
||||
// if (CMenuManager::OS_Language == LANG_FRENCH || CMenuManager::OS_Language == LANG_GERMAN)
|
||||
// PlayMovieInWindow(cmdShow, "movies\\GTAtitlesGER.mpg");
|
||||
// else
|
||||
// PlayMovieInWindow(cmdShow, "movies\\GTAtitles.mpg");
|
||||
|
||||
gGameState = GS_INTRO_MPEG;
|
||||
TRACE("gGameState = GS_INTRO_MPEG;");
|
||||
break;
|
||||
}
|
||||
|
||||
case GS_INTRO_MPEG:
|
||||
{
|
||||
// CPad::UpdatePads();
|
||||
//
|
||||
// if (startupDeactivate || ControlsManager.GetJoyButtonJustDown() != 0)
|
||||
++gGameState;
|
||||
// else if (CPad::GetPad(0)->GetLeftMouseJustDown())
|
||||
// ++gGameState;
|
||||
// else if (CPad::GetPad(0)->GetEnterJustDown())
|
||||
// ++gGameState;
|
||||
// else if (CPad::GetPad(0)->GetCharJustDown(' '))
|
||||
// ++gGameState;
|
||||
// else if (CPad::GetPad(0)->GetAltJustDown())
|
||||
// ++gGameState;
|
||||
// else if (CPad::GetPad(0)->GetTabJustDown())
|
||||
// ++gGameState;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case GS_INIT_ONCE:
|
||||
{
|
||||
//CoUninitialize();
|
||||
|
@ -1833,8 +1913,10 @@ main(int argc, char *argv[])
|
|||
{
|
||||
if ( gGameState == GS_PLAYING_GAME )
|
||||
CGame::ShutDown();
|
||||
#ifndef MASTER
|
||||
else if ( gGameState == GS_ANIMVIEWER )
|
||||
CAnimViewer::Shutdown();
|
||||
#endif
|
||||
|
||||
CTimer::Stop();
|
||||
|
||||
|
@ -1858,8 +1940,10 @@ main(int argc, char *argv[])
|
|||
|
||||
if ( gGameState == GS_PLAYING_GAME )
|
||||
CGame::ShutDown();
|
||||
#ifndef MASTER
|
||||
else if ( gGameState == GS_ANIMVIEWER )
|
||||
CAnimViewer::Shutdown();
|
||||
#endif
|
||||
|
||||
DMAudio.Terminate();
|
||||
|
||||
|
|
|
@ -134,7 +134,23 @@ public:
|
|||
void ReduceHornCounter(void);
|
||||
};
|
||||
|
||||
// These functions and function names are made up
|
||||
|
||||
inline int8 GetBikeDoorFlag(int32 carnode) {
|
||||
switch (carnode) {
|
||||
case CAR_DOOR_RR:
|
||||
case CAR_DOOR_LR:
|
||||
return CAR_DOOR_FLAG_RR | CAR_DOOR_FLAG_LR;
|
||||
case CAR_DOOR_RF:
|
||||
case CAR_DOOR_LF:
|
||||
return CAR_DOOR_FLAG_RF | CAR_DOOR_FLAG_LF;
|
||||
default:
|
||||
return CAR_DOOR_FLAG_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
// for m_nGettingOutFlags
|
||||
inline int8 GetBikeDoorFlagInclJumpInFromFront(int32 carnode) {
|
||||
switch (carnode) {
|
||||
case CAR_DOOR_RR:
|
||||
case CAR_DOOR_LR:
|
||||
|
|
Loading…
Reference in a new issue