1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-11-05 06:55:55 +00:00

Merge remote-tracking branch 'upstream/miami' into miami

This commit is contained in:
Nikolay Korolev 2020-09-30 15:19:55 +03:00
commit 4c582b19eb
23 changed files with 806 additions and 232 deletions

View file

@ -14,7 +14,7 @@ such that we have a working game at all times.
## How can I try it?
- re3 requires game assets to work, so you **must** own a copy of GTA III.
- re3 requires game assets to work, so you **must** own [a copy of GTA III](https://store.steampowered.com/app/12100/Grand_Theft_Auto_III/).
- Build re3 or download it from one of the above links (Debug or Release).
- (Optional) If you want to use optional features like Russian language or menu map, copy the files in /gamefiles folder to your game root folder.
- Move re3.exe to GTA 3 directory and run it.

View file

@ -47,6 +47,8 @@ function getarch(a)
return 'amd64'
elseif a == 'ARM' then
return 'arm'
elseif a == 'ARM64' then
return 'arm64'
end
return a
end
@ -75,6 +77,7 @@ workspace "reVC"
"linux-x86-librw_gl3_glfw-oal",
"linux-amd64-librw_gl3_glfw-oal",
"linux-arm-librw_gl3_glfw-oal",
"linux-arm64-librw_gl3_glfw-oal",
}
filter { "system:bsd" }

File diff suppressed because it is too large Load diff

View file

@ -811,7 +811,11 @@ cAudioManager::ProcessActiveQueues()
if (sample.m_nFrequency != m_asActiveSamples[j].m_nFrequency) {
int32 freq;
if (sample.m_nFrequency <= m_asActiveSamples[j].m_nFrequency) {
freq = Max(sample.m_nFrequency, m_asActiveSamples[j].m_nFrequency - 6000);
#ifdef FIX_BUGS
freq = Max((int32)sample.m_nFrequency, (int32)m_asActiveSamples[j].m_nFrequency - 6000);
#else
freq = Max((int32)sample.m_nFrequency, int32(m_asActiveSamples[j].m_nFrequency - 6000));
#endif
} else {
freq = Min(sample.m_nFrequency, m_asActiveSamples[j].m_nFrequency + 6000);
}

View file

@ -241,13 +241,13 @@ public:
// "Should" be in alphabetic order, except "getXTalkSfx"
void AddDetailsToRequestedOrderList(uint8 sample);
void AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sample, uint8 bank,
uint8 counter, bool notLooping);
uint8 counter, bool notLooping); //done
void AddReflectionsToRequestedQueue();
void AddReleasingSounds();
void AddSampleToRequestedQueue();
void AgeCrimes();
void CalculateDistance(bool &condition, float dist);
void CalculateDistance(bool &condition, float dist); //done
bool CheckForAnAudioFileOnCD() const;
void ClearActiveSamples();
void ClearMissionAudio(uint8 slot);
@ -275,7 +275,7 @@ public:
float GetCollisionLoopingRatio(uint32 a, uint32 b, float c) const; // not used
float GetCollisionOneShotRatio(int32 a, float b) const;
float GetCollisionRatio(float a, float b, float c, float d) const;
float GetDistanceSquared(const CVector &v) const;
float GetDistanceSquared(const CVector &v) const; //done
int32 GetJumboTaxiFreq() const;
uint8 GetMissionAudioLoadingStatus(uint8 slot) const;
int8 GetMissionScriptPoliceAudioPlayingStatus() const;
@ -287,7 +287,7 @@ public:
float GetVehicleNonDriveWheelSkidValue(uint8 wheel, CAutomobile *automobile,
cTransmission *transmission, float velocityChange);
bool HasAirBrakes(int32 model) const;
bool HasAirBrakes(int32 model) const; //done
void Initialise();
void InitialisePoliceRadio();
@ -302,13 +302,13 @@ public:
void PlayLoadedMissionAudio(uint8 slot);
void PlayOneShot(int32 index, int16 sound, float vol);
void PlaySuspectLastSeen(float x, float y, float z);
void PlayerJustGotInCar() const;
void PlayerJustLeftCar() const;
void PlayerJustGotInCar() const; //done
void PlayerJustLeftCar() const; //done
void PostInitialiseGameSpecificSetup();
void PostTerminateGameSpecificShutdown();
void PreInitialiseGameSpecificSetup() const;
void PostTerminateGameSpecificShutdown(); //done
void PreInitialiseGameSpecificSetup() const; //done
void PreloadMissionAudio(uint8 slot, Const char *name);
void PreTerminateGameSpecificShutdown();
void PreTerminateGameSpecificShutdown(); //done
/// processX - main logic of adding new sounds
void ProcessActiveQueues();
bool ProcessAirBrakes(cVehicleParams *params);
@ -320,17 +320,18 @@ public:
void ProcessBridgeOneShots();
void ProcessBridgeWarning();
#endif
bool ProcessCarBombTick(cVehicleParams *params);
bool ProcessCarBombTick(cVehicleParams *params); //done
void ProcessCesna(cVehicleParams *params);
//void ProcessCrane();
bool ProcessEngineDamage(cVehicleParams *params);
void ProcessEntity(int32 sound);
bool ProcessEngineDamage(cVehicleParams *params); //done
void ProcessEntity(int32 sound); //done
void ProcessExplosions(int32 explosion);
void ProcessFireHydrant();
void ProcessFires(int32 entity);
void ProcessFrontEnd();
void ProcessGarages();
bool ProcessHelicopter(cVehicleParams *params);
void ProcessCarHeli(cVehicleParams* params); //done
void ProcessVehicleFlatTyre(cVehicleParams* params); //done
void ProcessJumbo(cVehicleParams *);
void ProcessJumboAccel(CPlane *plane);
void ProcessJumboDecel(CPlane *plane);
@ -345,22 +346,22 @@ public:
void ProcessOneShotScriptObject(uint8 sound);
void ProcessPed(CPhysical *ped);
void ProcessPedOneShots(cPedParams *params);
void ProcessPhysical(int32 id);
void ProcessPlane(cVehicleParams *params);
void ProcessPlayersVehicleEngine(cVehicleParams *params, CVehicle* veh);
void ProcessPhysical(int32 id); //done
void ProcessPlane(cVehicleParams *params); //done
void ProcessPlayersVehicleEngine(cVehicleParams *params, CVehicle* veh); //done
void ProcessProjectiles();
void ProcessRainOnVehicle(cVehicleParams *params);
void ProcessReverb() const;
bool ProcessReverseGear(cVehicleParams *params);
void ProcessScriptObject(int32 id);
bool ProcessReverseGear(cVehicleParams *params); //done
void ProcessScriptObject(int32 id); //done
void ProcessSpecial();
#ifdef GTA_TRAIN
bool ProcessTrainNoise(cVehicleParams *params);
#endif
void ProcessVehicle(CVehicle *vehicle);
bool ProcessVehicleDoors(cVehicleParams *params);
void ProcessVehicleEngine(cVehicleParams *params);
void UpdateGasPedalAudio(CVehicle* veh, int vehType);
void ProcessVehicle(CVehicle *vehicle); //done, but need add model functions
bool ProcessVehicleDoors(cVehicleParams *params); //done
void ProcessVehicleEngine(cVehicleParams *params); //done
void UpdateGasPedalAudio(CVehicle* veh, int vehType); //done
void ProcessVehicleHorn(cVehicleParams *params);
void ProcessVehicleOneShots(cVehicleParams *params);
bool ProcessVehicleReverseWarning(cVehicleParams *params);
@ -368,8 +369,10 @@ public:
bool ProcessVehicleSirenOrAlarm(cVehicleParams *params);
bool ProcessVehicleSkidding(cVehicleParams *params);
void ProcessWaterCannon(int32);
void ProcessWeather(int32 id);
void ProcessWeather(int32 id); //done
bool ProcessWetRoadNoise(cVehicleParams *params);
void ProcessEscalators(); //done
void ProcessExtraSounds(); //done
int32 RandomDisplacement(uint32 seed) const;
void ReacquireDigitalHandle() const;
@ -402,11 +405,11 @@ public:
void SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter);
void SetUpOneShotCollisionSound(const cAudioCollision &col);
bool SetupCrimeReport();
bool SetupJumboEngineSound(uint8 vol, int32 freq);
bool SetupJumboEngineSound(uint8 vol, uint32 freq);
bool SetupJumboFlySound(uint8 emittingVol);
bool SetupJumboRumbleSound(uint8 emittingVol);
bool SetupJumboTaxiSound(uint8 vol);
bool SetupJumboWhineSound(uint8 emittingVol, int32 freq);
bool SetupJumboWhineSound(uint8 emittingVol, uint32 freq);
void SetupPedComments(cPedParams *params, uint32 sound);
void SetupSuspectLastSeenReport();
@ -414,11 +417,11 @@ public:
void TranslateEntity(Const CVector *v1, CVector *v2) const;
void UpdateReflections();
bool UsesReverseWarning(int32 model) const;
bool UsesReverseWarning(int32 model) const; //done
bool UsesSiren(int32 model) const;
bool UsesSirenSwitching(int32 model) const;
CVehicle *FindVehicleOfPlayer();
CVehicle *FindVehicleOfPlayer(); //done
void SetPedTalkingStatus(CPed *ped, uint8 status);
void SetPlayersMood(uint8 mood, int32 time);

View file

@ -6,7 +6,7 @@
cSampleManager SampleManager;
bool _bSampmanInitialised = false;
uint32 BankStartOffset[MAX_SAMPLEBANKS];
uint32 BankStartOffset[MAX_SFX_BANKS];
uint32 nNumMP3s;
cSampleManager::cSampleManager(void)
@ -136,20 +136,20 @@ cSampleManager::SetMonoMode(uint8 nMode)
bool
cSampleManager::LoadSampleBank(uint8 nBank)
{
ASSERT( nBank < MAX_SAMPLEBANKS );
ASSERT( nBank < MAX_SFX_BANKS );
return false;
}
void
cSampleManager::UnloadSampleBank(uint8 nBank)
{
ASSERT( nBank < MAX_SAMPLEBANKS );
ASSERT( nBank < MAX_SFX_BANKS );
}
bool
cSampleManager::IsSampleBankLoaded(uint8 nBank)
{
ASSERT( nBank < MAX_SAMPLEBANKS );
ASSERT( nBank < MAX_SFX_BANKS );
return false;
}
@ -179,7 +179,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
int32
cSampleManager::GetBankContainingSound(uint32 offset)
{
return SAMPLEBANK_INVALID;
return INVALID_SFX_BANK;
}
int32

View file

@ -1819,7 +1819,13 @@ CVehicle* CStoredCar::RestoreCar()
#ifdef FIX_BUGS
if (pVehicle->IsCar())
#endif
{
((CAutomobile*)pVehicle)->m_bombType = m_nCarBombType;
#ifdef FIX_BUGS
if (m_nCarBombType != CARBOMB_NONE)
((CAutomobile*)pVehicle)->m_pBombRigger = FindPlayerPed();
#endif
}
pVehicle->bHasBeenOwnedByPlayer = true;
pVehicle->m_nDoorLock = CARLOCK_UNLOCKED;
pVehicle->bBulletProof = m_bBulletproof;

View file

@ -106,12 +106,14 @@ CdStreamInit(int32 numChannels)
GetDiskFreeSpace(nil, &SectorsPerCluster, &BytesPerSector, &NumberOfFreeClusters, &TotalNumberOfClusters);
_gdwCdStreamFlags = 0;
#ifndef FIX_BUGS // this just slows down streaming
if ( BytesPerSector <= CDSTREAM_SECTOR_SIZE )
{
_gdwCdStreamFlags |= FILE_FLAG_NO_BUFFERING;
debug("Using no buffered loading for streaming\n");
}
#endif
_gbCdStreamOverlapped = TRUE;

View file

@ -733,9 +733,6 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonDown_Driving(int32
FindPlayerVehicle()->GetModelIndex() == MI_DODO
#ifdef FIX_BUGS
|| (CVehicle::bAllDodosCheat && !FindPlayerVehicle()->IsRealHeli())
#ifdef ALLCARSHELI_CHEAT
|| bAllCarCheat
#endif
#endif
)))
{

View file

@ -526,7 +526,7 @@ void KangarooCheat()
}
#endif
#ifdef ALLCARSHELI_CHEAT
#ifdef RESTORE_ALLCARSHELI_CHEAT
void AllCarsHeliCheat(void)
{
wchar* string;
@ -1438,7 +1438,7 @@ void CPad::AddToPCCheatString(char c)
CPed::SwitchDebugDisplay();
#endif
#ifdef ALLCARSHELI_CHEAT
#ifdef RESTORE_ALLCARSHELI_CHEAT
// "CARSAREHELI"
if (!_CHEATCMP("ILEHERASRAC"))
AllCarsHeliCheat();

View file

@ -286,6 +286,8 @@ public:
bool GetMiddleMouseJustUp() { return !!(!NewMouseControllerState.MMB && OldMouseControllerState.MMB); }
bool GetMouseWheelUpJustUp() { return !!(!NewMouseControllerState.WHEELUP && OldMouseControllerState.WHEELUP); }
bool GetMouseWheelDownJustUp() { return !!(!NewMouseControllerState.WHEELDN && OldMouseControllerState.WHEELDN); }
bool GetMouseX1JustUp() { return !!(!NewMouseControllerState.MXB1 && OldMouseControllerState.MXB1); }
bool GetMouseX2JustUp() { return !!(!NewMouseControllerState.MXB2 && OldMouseControllerState.MXB2); }
bool GetLeftMouse() { return NewMouseControllerState.LMB; }
bool GetRightMouse() { return NewMouseControllerState.RMB; }
@ -469,8 +471,4 @@ public:
};
VALIDATE_SIZE(CPad, 0xFC);
extern CPad Pads[MAX_PADS];
#ifdef ALLCARSHELI_CHEAT
extern bool bAllCarCheat;
#endif
extern CPad Pads[MAX_PADS];

View file

@ -1151,6 +1151,10 @@ int CRadar::SetCoordBlip(eBlipType type, CVector pos, int32 color, eBlipDisplay
if (!ms_RadarTrace[nextBlip].m_bInUse)
break;
}
#ifdef FIX_BUGS
if (nextBlip == NUMRADARBLIPS)
return -1;
#endif
ms_RadarTrace[nextBlip].m_eBlipType = type;
ms_RadarTrace[nextBlip].m_nColor = color;
ms_RadarTrace[nextBlip].m_bDim = true;
@ -1182,6 +1186,10 @@ int CRadar::SetEntityBlip(eBlipType type, int32 handle, int32 color, eBlipDispla
if (!ms_RadarTrace[nextBlip].m_bInUse)
break;
}
#ifdef FIX_BUGS
if (nextBlip == NUMRADARBLIPS)
return -1;
#endif
ms_RadarTrace[nextBlip].m_eBlipType = type;
ms_RadarTrace[nextBlip].m_nColor = color;
ms_RadarTrace[nextBlip].m_bDim = true;
@ -1526,6 +1534,10 @@ CRadar::ToggleTargetMarker(float x, float y)
if (!ms_RadarTrace[nextBlip].m_bInUse)
break;
}
#ifdef FIX_BUGS
if (nextBlip == NUMRADARBLIPS)
return;
#endif
ms_RadarTrace[nextBlip].m_eBlipType = BLIP_COORD;
ms_RadarTrace[nextBlip].m_nColor = 0x333333FF;
ms_RadarTrace[nextBlip].m_bDim = 1;

View file

@ -219,6 +219,8 @@ extern int strncasecmp(const char *str1, const char *str2, size_t len);
#define clamp(v, low, high) ((v)<(low) ? (low) : (v)>(high) ? (high) : (v))
#define clamp2(v, center, radius) ((v) < (center) ? Max(v, center - radius) : Min(v, center + radius))
inline float sq(float x) { return x*x; }
#define SQR(x) ((x) * (x))

View file

@ -250,7 +250,7 @@ enum Config {
#endif
#define DETECT_PAD_INPUT_SWITCH // Adds automatic switch of pad related stuff between controller and kb/m
#define KANGAROO_CHEAT
#define ALLCARSHELI_CHEAT
#define RESTORE_ALLCARSHELI_CHEAT
#define ALT_DODO_CHEAT
#define WALLCLIMB_CHEAT
#define REGISTER_START_BUTTON
@ -258,14 +258,13 @@ enum Config {
// Hud, frontend and radar
#define HUD_ENHANCEMENTS // Adjusts some aspects to make the HUD look/behave a little bit better.
#define BETA_SLIDING_TEXT
//#define BETA_SLIDING_TEXT
#define TRIANGULAR_BLIPS // height indicating triangular radar blips, as in VC
#define PC_MENU
#ifndef PC_MENU
# define PS2_MENU
//# define PS2_MENU_USEALLPAGEICONS
//# define PS2_LIKE_MENU // An effort to recreate PS2 menu, cycling through tabs, different bg etc.
#else
# define MAP_ENHANCEMENTS // Adding waypoint etc.
# define TRIANGLE_BACK_BUTTON

View file

@ -50,7 +50,7 @@ void tbInit()
#endif
}
void tbStartTimer(int32 unk, char *name)
void tbStartTimer(int32 unk, Const char *name)
{
strcpy(TimerBar.Timers[TimerBar.count].name, name);
TimerBar.Timers[TimerBar.count].unk = unk;
@ -58,7 +58,7 @@ void tbStartTimer(int32 unk, char *name)
TimerBar.count++;
}
void tbEndTimer(char* name)
void tbEndTimer(Const char* name)
{
uint32 n = 1500;
for (uint32 i = 0; i < TimerBar.count; i++) {

View file

@ -1,6 +1,6 @@
#pragma once
void tbInit();
void tbStartTimer(int32, char*);
void tbEndTimer(char*);
void tbStartTimer(int32, Const char*);
void tbEndTimer(Const char*);
void tbDisplay();

View file

@ -103,6 +103,8 @@ public:
void Update(void);
void SwitchOff(void);
void AddThisOne(CVector pos0, CVector pos1, CVector pos2, CVector pos3, bool b_isMovingDown);
bool IsActive() const { return m_bIsActive; };
const CVector& GetPosition() const { return m_midPoint; };
};
class CEscalators
@ -114,6 +116,7 @@ public:
static void Update(void);
static void AddOne(CVector pos0, CVector pos1, CVector pos2, CVector pos3, bool b_isMovingDown);
static void Shutdown(void);
static const CEscalator& GetEscalator(int ind) { return aEscalators[ind]; };
};
class CMovingThing

View file

@ -1099,8 +1099,11 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
if ( wParam == VK_SHIFT )
_InputTranslateShiftKeyUpDown(&ks);
#ifdef FIX_BUGS
break;
#else
return 0L;
#endif
}
case WM_KEYUP:
@ -1113,7 +1116,11 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
if ( wParam == VK_SHIFT )
_InputTranslateShiftKeyUpDown(&ks);
#ifdef FIX_BUGS
break;
#else
return 0L;
#endif
}
case WM_SYSKEYDOWN:
@ -1126,7 +1133,11 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
if ( wParam == VK_SHIFT )
_InputTranslateShiftKeyUpDown(&ks);
#ifdef FIX_BUGS
break;
#else
return 0L;
#endif
}
case WM_SYSKEYUP:
@ -1139,7 +1150,11 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
if ( wParam == VK_SHIFT )
_InputTranslateShiftKeyUpDown(&ks);
#ifdef FIX_BUGS
break;
#else
return 0L;
#endif
}
case WM_ACTIVATEAPP:
@ -2508,8 +2523,10 @@ WinMain(HINSTANCE instance,
{
if ( gGameState == GS_PLAYING_GAME )
CGame::ShutDown();
#ifndef MASTER
else if ( gGameState == GS_ANIMVIEWER )
CAnimViewer::Shutdown();
#endif
CTimer::Stop();
@ -2533,8 +2550,10 @@ WinMain(HINSTANCE instance,
if ( gGameState == GS_PLAYING_GAME )
CGame::ShutDown();
#ifndef MASTER
else if ( gGameState == GS_ANIMVIEWER )
CAnimViewer::Shutdown();
#endif
DMAudio.Terminate();

View file

@ -100,7 +100,7 @@ CAutomobile::CAutomobile(int32 id, uint8 CreatedBy)
}
pHandling = mod_HandlingManager.GetHandlingData((eHandlingId)mi->m_handlingId);
pFlyingHandling = mod_HandlingManager.GetFlyingPointer((eHandlingId)mi->m_handlingId);
pFlyingHandling = mod_HandlingManager.GetFlyingPointer((eHandlingId)mi->m_handlingId);
m_auto_unused1 = 20.0f;
m_auto_unused2 = 0;
@ -1293,7 +1293,7 @@ CAutomobile::ProcessControl(void)
// Process front wheels off ground
if(!IsRealHeli()){
if (!IsRealHeli()) {
if(m_aWheelTimer[CARWHEEL_FRONT_LEFT] <= 0.0f){
if(mod_HandlingManager.HasRearWheelDrive(pHandling->nIdentifier) || acceleration == 0.0f)
m_aWheelSpeed[CARWHEEL_FRONT_LEFT] *= 0.95f;
@ -1400,24 +1400,31 @@ CAutomobile::ProcessControl(void)
}else if(GetModelIndex() == MI_RCBARON){
FlyingControl(FLIGHT_MODEL_RCPLANE);
}else if(IsRealHeli() || bAllCarCheat){
// Speed up rotor
if(m_aWheelSpeed[1] < 0.22f && !bIsInWater){
if(GetModelIndex() == MI_RCRAIDER || GetModelIndex() == MI_RCGOBLIN)
m_aWheelSpeed[1] += 0.003f;
else
m_aWheelSpeed[1] += 0.001f;
}
#ifdef RESTORE_ALLCARSHELI_CHEAT
if (bAllCarCheat)
FlyingControl(FLIGHT_MODEL_HELI);
else
#endif
{
// Speed up rotor
if (m_aWheelSpeed[1] < 0.22f && !bIsInWater) {
if (GetModelIndex() == MI_RCRAIDER || GetModelIndex() == MI_RCGOBLIN)
m_aWheelSpeed[1] += 0.003f;
else
m_aWheelSpeed[1] += 0.001f;
}
// Fly
if(m_aWheelSpeed[1] > 0.15f){
if(GetModelIndex() == MI_RCRAIDER || GetModelIndex() == MI_RCGOBLIN)
FlyingControl(FLIGHT_MODEL_RCHELI);
else if(m_nWheelsOnGround < 4 && !(GetModelIndex() == MI_SEASPAR && bTouchingWater) ||
CPad::GetPad(0)->GetAccelerate() != 0 || CPad::GetPad(0)->GetCarGunUpDown() > 1.0f ||
Abs(m_vecMoveSpeed.x) > 0.02f ||
Abs(m_vecMoveSpeed.y) > 0.02f ||
Abs(m_vecMoveSpeed.z) > 0.02f)
FlyingControl(FLIGHT_MODEL_HELI);
// Fly
if (m_aWheelSpeed[1] > 0.15f) {
if (GetModelIndex() == MI_RCRAIDER || GetModelIndex() == MI_RCGOBLIN)
FlyingControl(FLIGHT_MODEL_RCHELI);
else if (m_nWheelsOnGround < 4 && !(GetModelIndex() == MI_SEASPAR && bTouchingWater) ||
CPad::GetPad(0)->GetAccelerate() != 0 || CPad::GetPad(0)->GetCarGunUpDown() > 1.0f ||
Abs(m_vecMoveSpeed.x) > 0.02f ||
Abs(m_vecMoveSpeed.y) > 0.02f ||
Abs(m_vecMoveSpeed.z) > 0.02f)
FlyingControl(FLIGHT_MODEL_HELI);
}
}
// Blade collision
@ -1489,7 +1496,7 @@ CAutomobile::ProcessControl(void)
CMatrix mat;
mat.Attach(RwFrameGetMatrix(m_aCarNodes[CAR_BONNET]));
CVector blade = mat.GetRight();
blade = GetMatrix() * blade;
blade = Multiply3x3(blade, GetMatrix());
camDist /= Max(Sqrt(distSq), 0.01f);
if(Abs(DotProduct(camDist, blade)) > 0.95f){
DMAudio.PlayOneShot(m_audioEntityId, SOUND_31, 0.0f);

View file

@ -167,4 +167,5 @@ public:
static void SetAllTaxiLights(bool set);
};
extern CVector vecHunterGunPos;
extern CVector vecHunterGunPos;
extern bool bAllCarCheat;

View file

@ -32,7 +32,7 @@ void CCarGenerator::SwitchOff()
void CCarGenerator::SwitchOn()
{
m_nUsesRemaining = 255;
m_nUsesRemaining = UINT16_MAX;
m_nTimer = CalcNextGen();
++CTheCarGenerators::CurrentActiveCount;
}
@ -143,10 +143,10 @@ void CCarGenerator::DoInternalProcessing()
m_nVehicleHandle = CPools::GetVehiclePool()->GetIndex(pVehicle);
/* I don't think this is a correct comparasion */
#ifdef FIX_BUGS
if (m_nUsesRemaining != 0)
if (m_nUsesRemaining < UINT16_MAX)
--m_nUsesRemaining;
#else
if (m_nUsesRemaining < -1)
if (m_nUsesRemaining < ~0)
--m_nUsesRemaining;
#endif
m_nTimer = CalcNextGen();

View file

@ -48,8 +48,10 @@ CDamageManager::FuckCarCompletely(void)
#endif
}
// Why set to no damage?
#ifndef FIX_BUGS
m_lightStatus = 0;
m_panelStatus = 0;
#endif
SetEngineStatus(250);
}

View file

@ -432,7 +432,12 @@ CVehicle::FlyingControl(eFlightModel flightModel)
case FLIGHT_MODEL_RCHELI:
case FLIGHT_MODEL_HELI:
{
float rm = Pow(pFlyingHandling->fMoveRes, CTimer::GetTimeStep());
#ifdef RESTORE_ALLCARSHELI_CHEAT
tFlyingHandlingData* flyingHandling = bAllCarCheat && GetStatus() == STATUS_PLAYER && !IsRealHeli() ? mod_HandlingManager.GetFlyingPointer(HANDLING_MAVERICK) : pFlyingHandling;
#else
tFlyingHandlingData* flyingHandling = pFlyingHandling;
#endif
float rm = Pow(flyingHandling->fMoveRes, CTimer::GetTimeStep());
m_vecMoveSpeed *= rm;
if (GetStatus() != STATUS_PLAYER && GetStatus() != STATUS_PLAYER_REMOTE)
return;
@ -441,11 +446,11 @@ CVehicle::FlyingControl(eFlightModel flightModel)
if(fThrust < 0.0f)
fThrust *= 2.0f;
if(flightModel == FLIGHT_MODEL_RCHELI){
fThrust = pFlyingHandling->fThrust * fThrust + 0.45f;
fThrust = flyingHandling->fThrust * fThrust + 0.45f;
ApplyMoveForce(GRAVITY * CVector(0.0f, 0.0f, 0.5f) * m_fMass * CTimer::GetTimeStep());
}else
fThrust = pFlyingHandling->fThrust * fThrust + 0.95f;
fThrust -= pFlyingHandling->fThrustFallOff * fUpSpeed;
fThrust = flyingHandling->fThrust * fThrust + 0.95f;
fThrust -= flyingHandling->fThrustFallOff * fUpSpeed;
if(flightModel == FLIGHT_MODEL_RCHELI && GetPosition().z > 40.0f)
fThrust *= 10.0f/(GetPosition().z - 30.0f);
else if(GetPosition().z > 80.0f)
@ -453,20 +458,20 @@ CVehicle::FlyingControl(eFlightModel flightModel)
ApplyMoveForce(GRAVITY * GetUp() * fThrust * m_fMass * CTimer::GetTimeStep());
if (GetUp().z > 0.0f){
float upRight = clamp(GetRight().z, -pFlyingHandling->fFormLift, pFlyingHandling->fFormLift);
float upImpulseRight = -upRight * pFlyingHandling->fAttackLift * m_fTurnMass * CTimer::GetTimeStep();
float upRight = clamp(GetRight().z, -flyingHandling->fFormLift, flyingHandling->fFormLift);
float upImpulseRight = -upRight * flyingHandling->fAttackLift * m_fTurnMass * CTimer::GetTimeStep();
ApplyTurnForce(upImpulseRight * GetUp(), GetRight());
float upFwd = clamp(GetForward().z, -pFlyingHandling->fFormLift, pFlyingHandling->fFormLift);
float upImpulseFwd = -upFwd * pFlyingHandling->fAttackLift * m_fTurnMass * CTimer::GetTimeStep();
float upFwd = clamp(GetForward().z, -flyingHandling->fFormLift, flyingHandling->fFormLift);
float upImpulseFwd = -upFwd * flyingHandling->fAttackLift * m_fTurnMass * CTimer::GetTimeStep();
ApplyTurnForce(upImpulseFwd * GetUp(), GetForward());
}else{
float upRight = GetRight().z < 0.0f ? -pFlyingHandling->fFormLift : pFlyingHandling->fFormLift;
float upImpulseRight = -upRight * pFlyingHandling->fAttackLift * m_fTurnMass * CTimer::GetTimeStep();
float upRight = GetRight().z < 0.0f ? -flyingHandling->fFormLift : flyingHandling->fFormLift;
float upImpulseRight = -upRight * flyingHandling->fAttackLift * m_fTurnMass * CTimer::GetTimeStep();
ApplyTurnForce(upImpulseRight * GetUp(), GetRight());
float upFwd = GetForward().z < 0.0f ? -pFlyingHandling->fFormLift : pFlyingHandling->fFormLift;
float upImpulseFwd = -upFwd * pFlyingHandling->fAttackLift * m_fTurnMass * CTimer::GetTimeStep();
float upFwd = GetForward().z < 0.0f ? -flyingHandling->fFormLift : flyingHandling->fFormLift;
float upImpulseFwd = -upFwd * flyingHandling->fAttackLift * m_fTurnMass * CTimer::GetTimeStep();
ApplyTurnForce(upImpulseFwd * GetUp(), GetForward());
}
@ -490,25 +495,25 @@ CVehicle::FlyingControl(eFlightModel flightModel)
fPitch = -CPad::GetPad(0)->GetCarGunUpDown() / 128.0f;
if (CPad::GetPad(0)->GetHorn()) {
fYaw = 0.0f;
fPitch = clamp(pFlyingHandling->fPitchStab * DotProduct(m_vecMoveSpeed, GetForward()), -200.0f, 1.3f);
fRoll = clamp(pFlyingHandling->fRollStab * DotProduct(m_vecMoveSpeed, GetRight()), -200.0f, 1.3f);
fPitch = clamp(flyingHandling->fPitchStab * DotProduct(m_vecMoveSpeed, GetForward()), -200.0f, 1.3f);
fRoll = clamp(flyingHandling->fRollStab * DotProduct(m_vecMoveSpeed, GetRight()), -200.0f, 1.3f);
}
ApplyTurnForce(fPitch * GetUp() * pFlyingHandling->fPitch * m_fTurnMass * CTimer::GetTimeStep(), GetForward());
ApplyTurnForce(fRoll * GetUp() * pFlyingHandling->fRoll * m_fTurnMass * CTimer::GetTimeStep(), GetRight());
ApplyTurnForce(fPitch * GetUp() * flyingHandling->fPitch * m_fTurnMass * CTimer::GetTimeStep(), GetForward());
ApplyTurnForce(fRoll * GetUp() * flyingHandling->fRoll * m_fTurnMass * CTimer::GetTimeStep(), GetRight());
float fSideSpeed = -DotProduct(GetMoveSpeed(), GetRight());
float fSideSlipAccel = pFlyingHandling->fSideSlip * fSideSpeed * Abs(fSideSpeed);
float fSideSlipAccel = flyingHandling->fSideSlip * fSideSpeed * Abs(fSideSpeed);
ApplyMoveForce(m_fMass * GetRight() * fSideSlipAccel * CTimer::GetTimeStep());
float fYawAccel = pFlyingHandling->fYawStab * fSideSpeed * Abs(fSideSpeed) + pFlyingHandling->fYaw * fYaw;
float fYawAccel = flyingHandling->fYawStab * fSideSpeed * Abs(fSideSpeed) + flyingHandling->fYaw * fYaw;
ApplyTurnForce(fYawAccel * GetRight() * m_fTurnMass * CTimer::GetTimeStep(), -GetForward());
ApplyTurnForce(fYaw * GetForward() * pFlyingHandling->fYaw * m_fTurnMass * CTimer::GetTimeStep(), GetRight());
ApplyTurnForce(fYaw * GetForward() * flyingHandling->fYaw * m_fTurnMass * CTimer::GetTimeStep(), GetRight());
float rX = Pow(pFlyingHandling->vecTurnRes.x, CTimer::GetTimeStep());
float rY = Pow(pFlyingHandling->vecTurnRes.y, CTimer::GetTimeStep());
float rZ = Pow(pFlyingHandling->vecTurnRes.z, CTimer::GetTimeStep());
float rX = Pow(flyingHandling->vecTurnRes.x, CTimer::GetTimeStep());
float rY = Pow(flyingHandling->vecTurnRes.y, CTimer::GetTimeStep());
float rZ = Pow(flyingHandling->vecTurnRes.z, CTimer::GetTimeStep());
CVector vecTurnSpeed = Multiply3x3(m_vecTurnSpeed, GetMatrix());
float fResistanceMultiplier = Pow(1.0f / (pFlyingHandling->vecSpeedRes.z * SQR(vecTurnSpeed.z) + 1.0f) * rZ, CTimer::GetTimeStep());
float fResistanceMultiplier = Pow(1.0f / (flyingHandling->vecSpeedRes.z * SQR(vecTurnSpeed.z) + 1.0f) * rZ, CTimer::GetTimeStep());
float fResistance = vecTurnSpeed.z * fResistanceMultiplier - vecTurnSpeed.z;
vecTurnSpeed.x *= rX;
vecTurnSpeed.y *= rY;