Merge pull request #727 from erorcun/miami

Restore All Cars are Heli cheat
This commit is contained in:
erorcun 2020-09-29 22:42:08 +03:00 committed by GitHub
commit 1fa852f118
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 63 additions and 56 deletions

View file

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

View file

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

View file

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

View file

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

View file

@ -100,7 +100,7 @@ CAutomobile::CAutomobile(int32 id, uint8 CreatedBy)
} }
pHandling = mod_HandlingManager.GetHandlingData((eHandlingId)mi->m_handlingId); 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_unused1 = 20.0f;
m_auto_unused2 = 0; m_auto_unused2 = 0;
@ -1293,7 +1293,7 @@ CAutomobile::ProcessControl(void)
// Process front wheels off ground // Process front wheels off ground
if(!IsRealHeli()){ if (!IsRealHeli()) {
if(m_aWheelTimer[CARWHEEL_FRONT_LEFT] <= 0.0f){ if(m_aWheelTimer[CARWHEEL_FRONT_LEFT] <= 0.0f){
if(mod_HandlingManager.HasRearWheelDrive(pHandling->nIdentifier) || acceleration == 0.0f) if(mod_HandlingManager.HasRearWheelDrive(pHandling->nIdentifier) || acceleration == 0.0f)
m_aWheelSpeed[CARWHEEL_FRONT_LEFT] *= 0.95f; m_aWheelSpeed[CARWHEEL_FRONT_LEFT] *= 0.95f;
@ -1400,24 +1400,31 @@ CAutomobile::ProcessControl(void)
}else if(GetModelIndex() == MI_RCBARON){ }else if(GetModelIndex() == MI_RCBARON){
FlyingControl(FLIGHT_MODEL_RCPLANE); FlyingControl(FLIGHT_MODEL_RCPLANE);
}else if(IsRealHeli() || bAllCarCheat){ }else if(IsRealHeli() || bAllCarCheat){
// Speed up rotor #ifdef RESTORE_ALLCARSHELI_CHEAT
if(m_aWheelSpeed[1] < 0.22f && !bIsInWater){ if (bAllCarCheat)
if(GetModelIndex() == MI_RCRAIDER || GetModelIndex() == MI_RCGOBLIN) FlyingControl(FLIGHT_MODEL_HELI);
m_aWheelSpeed[1] += 0.003f; else
else #endif
m_aWheelSpeed[1] += 0.001f; {
} // 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 // Fly
if(m_aWheelSpeed[1] > 0.15f){ if (m_aWheelSpeed[1] > 0.15f) {
if(GetModelIndex() == MI_RCRAIDER || GetModelIndex() == MI_RCGOBLIN) if (GetModelIndex() == MI_RCRAIDER || GetModelIndex() == MI_RCGOBLIN)
FlyingControl(FLIGHT_MODEL_RCHELI); FlyingControl(FLIGHT_MODEL_RCHELI);
else if(m_nWheelsOnGround < 4 && !(GetModelIndex() == MI_SEASPAR && bTouchingWater) || else if (m_nWheelsOnGround < 4 && !(GetModelIndex() == MI_SEASPAR && bTouchingWater) ||
CPad::GetPad(0)->GetAccelerate() != 0 || CPad::GetPad(0)->GetCarGunUpDown() > 1.0f || CPad::GetPad(0)->GetAccelerate() != 0 || CPad::GetPad(0)->GetCarGunUpDown() > 1.0f ||
Abs(m_vecMoveSpeed.x) > 0.02f || Abs(m_vecMoveSpeed.x) > 0.02f ||
Abs(m_vecMoveSpeed.y) > 0.02f || Abs(m_vecMoveSpeed.y) > 0.02f ||
Abs(m_vecMoveSpeed.z) > 0.02f) Abs(m_vecMoveSpeed.z) > 0.02f)
FlyingControl(FLIGHT_MODEL_HELI); FlyingControl(FLIGHT_MODEL_HELI);
}
} }
// Blade collision // Blade collision

View file

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

View file

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