fixed top gear

This commit is contained in:
Nikolay Korolev 2020-11-11 12:21:30 +03:00
parent 612a6dd06c
commit be92957328
2 changed files with 14 additions and 14 deletions

View File

@ -1300,10 +1300,10 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams& params)
float relativeChange; float relativeChange;
float modificator; float modificator;
float traction; float traction;
bool pizzaFaggBool; bool isMoped;
bool caddyBool; bool caddyBool;
pizzaFaggBool = false; isMoped = false;
caddyBool = false; caddyBool = false;
traction = 0.0f; traction = 0.0f;
if (params.m_fDistance >= SQR(SOUND_INTENSITY)) if (params.m_fDistance >= SQR(SOUND_INTENSITY))
@ -1326,7 +1326,7 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams& params)
switch (veh->m_modelIndex) { switch (veh->m_modelIndex) {
case MI_PIZZABOY: case MI_PIZZABOY:
case MI_FAGGIO: case MI_FAGGIO:
pizzaFaggBool = true; isMoped = true;
currentGear = transmission->nNumberOfGears; currentGear = transmission->nNumberOfGears;
break; break;
case MI_CADDY: case MI_CADDY:
@ -1358,8 +1358,8 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams& params)
} }
if (wheelsOnGround != 0) { if (wheelsOnGround != 0) {
if (!veh->bIsHandbrakeOn || pizzaFaggBool && caddyBool) { //mb bug, bcs it's can't be true together if (!veh->bIsHandbrakeOn || isMoped && caddyBool) { //mb bug, bcs it's can't be true together
if (veh->GetStatus() == STATUS_SIMPLE || pizzaFaggBool || caddyBool) { if (veh->GetStatus() == STATUS_SIMPLE || isMoped || caddyBool) {
traction = 0.0f; traction = 0.0f;
} else { } else {
switch (transmission->nDriveType) { switch (transmission->nDriveType) {
@ -1407,7 +1407,7 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams& params)
relativeChange = 0.0f; relativeChange = 0.0f;
modificator = 0.0f; modificator = 0.0f;
} else { } else {
if (!pizzaFaggBool && !caddyBool) { if (!isMoped && !caddyBool) {
if (currentGear != 0) { if (currentGear != 0) {
relativeGearChange = Min(1.0f, relativeGearChange = Min(1.0f,
params.m_fVelocityChange - transmission->Gears[currentGear].fShiftDownVelocity) / transmission->fMaxVelocity * 2.5f; params.m_fVelocityChange - transmission->Gears[currentGear].fShiftDownVelocity) / transmission->fMaxVelocity * 2.5f;
@ -1669,7 +1669,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CVehicle* veh
bool noGearBox; bool noGearBox;
bool stuckInSand; bool stuckInSand;
bool processedAccelSampleStopped; bool processedAccelSampleStopped;
bool PizzaFaggBool; bool isMoped;
static uint32 gearSoundStartTime = CTimer::GetTimeInMilliseconds(); static uint32 gearSoundStartTime = CTimer::GetTimeInMilliseconds();
static int32 nCruising = 0; static int32 nCruising = 0;
@ -1680,7 +1680,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CVehicle* veh
static bool bAccelSampleStopped = true; static bool bAccelSampleStopped = true;
lostTraction = false; lostTraction = false;
PizzaFaggBool = params.m_pVehicle->m_modelIndex == MI_PIZZABOY || params.m_pVehicle->m_modelIndex == MI_FAGGIO; isMoped = params.m_pVehicle->m_modelIndex == MI_PIZZABOY || params.m_pVehicle->m_modelIndex == MI_FAGGIO;
processedAccelSampleStopped = false; processedAccelSampleStopped = false;
if (bPlayerJustEnteredCar) { if (bPlayerJustEnteredCar) {
bAccelSampleStopped = true; bAccelSampleStopped = true;
@ -1699,7 +1699,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CVehicle* veh
brakeState = Pads[0].GetBrake(); brakeState = Pads[0].GetBrake();
} }
channelUsed = SampleManager.GetChannelUsedFlag(m_nActiveSamples); channelUsed = SampleManager.GetChannelUsedFlag(m_nActiveSamples);
if (PizzaFaggBool) { if (isMoped) {
CurrentPretendGear = params.m_pTransmission->nNumberOfGears; CurrentPretendGear = params.m_pTransmission->nNumberOfGears;
currentGear = CurrentPretendGear; currentGear = CurrentPretendGear;
if (params.m_pVehicle->bIsHandbrakeOn) { if (params.m_pVehicle->bIsHandbrakeOn) {
@ -1735,7 +1735,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CVehicle* veh
debug(" ** AUDIOLOG: Unrecognised vehicle type %d in ProcessVehicleEngine() * \n", params.m_VehicleType); debug(" ** AUDIOLOG: Unrecognised vehicle type %d in ProcessVehicleEngine() * \n", params.m_VehicleType);
return; return;
} }
if (!PizzaFaggBool) { if (!isMoped) {
switch (params.m_pTransmission->nDriveType) { switch (params.m_pTransmission->nDriveType) {
case '4': case '4':
if (params.m_VehicleType != VEHICLE_TYPE_BIKE) { if (params.m_VehicleType != VEHICLE_TYPE_BIKE) {
@ -1882,7 +1882,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CVehicle* veh
|| params.m_pVehicle->bIsHandbrakeOn || params.m_pVehicle->bIsHandbrakeOn
|| lostTraction || lostTraction
|| params.m_fVelocityChange < 0.01f && *gasPedalAudioPtr > 0.2f) { || params.m_fVelocityChange < 0.01f && *gasPedalAudioPtr > 0.2f) {
if (PizzaFaggBool) { if (isMoped) {
gasPedalAudio = 0.0f; gasPedalAudio = 0.0f;
} else { } else {
*gasPedalAudioPtr *= 0.6f; *gasPedalAudioPtr *= 0.6f;
@ -2005,7 +2005,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CVehicle* veh
params.m_pVehicle->bAudioChangingGear = true; params.m_pVehicle->bAudioChangingGear = true;
bAccelSampleStopped = true; bAccelSampleStopped = true;
SampleManager.StopChannel(m_nActiveSamples); SampleManager.StopChannel(m_nActiveSamples);
if (PizzaFaggBool || accelerateState >= 150 && wheelsOnGround && brakeState <= 0 && !params.m_pVehicle->bIsHandbrakeOn if (isMoped || accelerateState >= 150 && wheelsOnGround && brakeState <= 0 && !params.m_pVehicle->bIsHandbrakeOn
&& !lostTraction && currentGear >= params.m_pTransmission->nNumberOfGears - 1) { && !lostTraction && currentGear >= params.m_pTransmission->nNumberOfGears - 1) {
if (accelerateState >= 220 && params.m_fVelocityChange + 0.001f >= velocityChangeForAudio) { if (accelerateState >= 220 && params.m_fVelocityChange + 0.001f >= velocityChangeForAudio) {
if (nCruising < 800) if (nCruising < 800)
@ -2023,10 +2023,9 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CVehicle* veh
} }
} }
} else { } else {
params.m_pVehicle->bAudioChangingGear = true;
bAccelSampleStopped = true; bAccelSampleStopped = true;
SampleManager.StopChannel(m_nActiveSamples); SampleManager.StopChannel(m_nActiveSamples);
if (PizzaFaggBool || accelerateState >= 150 && wheelsOnGround && brakeState <= 0 && !params.m_pVehicle->bIsHandbrakeOn if (isMoped || accelerateState >= 150 && wheelsOnGround && brakeState <= 0 && !params.m_pVehicle->bIsHandbrakeOn
&& !lostTraction && currentGear >= params.m_pTransmission->nNumberOfGears - 1) { && !lostTraction && currentGear >= params.m_pTransmission->nNumberOfGears - 1) {
if (accelerateState >= 220 && params.m_fVelocityChange + 0.001f >= velocityChangeForAudio) { if (accelerateState >= 220 && params.m_fVelocityChange + 0.001f >= velocityChangeForAudio) {
if (nCruising < 800) if (nCruising < 800)

View File

@ -1946,6 +1946,7 @@ CWorld::SetPedsChoking(float x, float y, float z, float radius, CEntity* reason)
int32 poolSize = CPools::GetPedPool()->GetSize(); int32 poolSize = CPools::GetPedPool()->GetSize();
for (int32 i = poolSize - 1; i >= 0; i--) { for (int32 i = poolSize - 1; i >= 0; i--) {
CPed* pPed = CPools::GetPedPool()->GetSlot(i); CPed* pPed = CPools::GetPedPool()->GetSlot(i);
// suspicious copypaste
if (pPed && pPed->m_nPedState != PED_DEAD && !pPed->bInVehicle && !pPed->m_pFire && !pPed->bFireProof && pPed->CharCreatedBy != MISSION_CHAR) { if (pPed && pPed->m_nPedState != PED_DEAD && !pPed->bInVehicle && !pPed->m_pFire && !pPed->bFireProof && pPed->CharCreatedBy != MISSION_CHAR) {
if (Abs(pPed->GetPosition().z - z) < 5.0f && Abs(pPed->GetPosition().x - x) < radius && if (Abs(pPed->GetPosition().z - z) < 5.0f && Abs(pPed->GetPosition().x - x) < radius &&
Abs(pPed->GetPosition().y - y) < radius) { Abs(pPed->GetPosition().y - y) < radius) {