summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/audio/AudioLogic.cpp2
-rw-r--r--src/control/Garages.cpp3
-rw-r--r--src/peds/Ped.cpp12
-rw-r--r--src/weapons/Weapon.cpp2
4 files changed, 11 insertions, 8 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp
index 2d8cebc2..2e2b7e1f 100644
--- a/src/audio/AudioLogic.cpp
+++ b/src/audio/AudioLogic.cpp
@@ -2965,7 +2965,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params)
CPed *pPed = params.m_pVehicle->pDriver;
if(!pPed)
break;
- if(!pPed->HasWeaponSlot(WEAPONSLOT_SUBMACHINEGUN)) {
+ if(!pPed->HasWeaponSlot(WEAPONSLOT_SUBMACHINEGUN) || (params.m_pVehicle->GetModelIndex() == MI_PREDATOR && !pPed->IsPedDoingDriveByShooting())) {
sampleIndex = SFX_UZI_LEFT;
frequency = SampleManager.GetSampleBaseFrequency(sampleIndex);
frequency += RandomDisplacement(frequency / 32);
diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp
index cbf17be9..2c0bf8f2 100644
--- a/src/control/Garages.cpp
+++ b/src/control/Garages.cpp
@@ -2618,6 +2618,9 @@ void CGarages::Save(uint8 * buf, uint32 * size)
//INITSAVEBUF
*size = 10692; // for some reason it's not actual size again
//*size = (6 * sizeof(uint32) + TOTAL_COLLECTCARS_GARAGES * sizeof(*CarTypesCollected) + sizeof(uint32) + TOTAL_HIDEOUT_GARAGES * NUM_GARAGE_STORED_CARS * sizeof(CStoredCar) + NUM_GARAGES * sizeof(CGarage));
+#if !defined THIS_IS_STUPID && defined COMPATIBLE_SAVES
+ memset(buf + 7340, 0, *size - 7340); // garbage data is written otherwise
+#endif
CloseHideOutGaragesBeforeSave();
WriteSaveBuf(buf, NumGarages);
WriteSaveBuf(buf, (uint32)BombsAreFree);
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index 9d261010..c0b1af23 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -2362,12 +2362,12 @@ CPed::ProcessControl(void)
} else {
obstacleForFlyingOtherDirZ = 501.0f;
}
- uint8 flyDir = 0;
+ int16 flyDir = 0;
float feetZ = GetPosition().z - FEET_OFFSET;
#ifdef FIX_BUGS
- if (obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ < 501.0f)
+ if (obstacleForFlyingZ > feetZ && obstacleForFlyingZ < 500.0f)
flyDir = 1;
- else if (obstacleForFlyingOtherDirZ > feetZ && obstacleForFlyingZ < 500.0f)
+ else if (obstacleForFlyingOtherDirZ > feetZ && obstacleForFlyingOtherDirZ < 501.0f)
flyDir = 2;
#else
if ((obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ < 500.0f) || (obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ > feetZ))
@@ -2376,8 +2376,8 @@ CPed::ProcessControl(void)
flyDir = 2;
#endif
- if (flyDir != 0 && !bHeadStuckInCollision) {
- SetPosition((flyDir == 2 ? obstacleForFlyingOtherDir.point : obstacleForFlying.point));
+ if (flyDir > 0 && !bHeadStuckInCollision) {
+ GetMatrix().SetTranslateOnly(flyDir == 2 ? obstacleForFlyingOtherDir.point : obstacleForFlying.point);
GetMatrix().GetPosition().z += FEET_OFFSET;
GetMatrix().UpdateRW();
SetLanding();
@@ -3009,7 +3009,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
lowerSpeedLimit *= 1.5f;
}
CAnimBlendAssociation *fallAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FALL);
- if (!bWasStanding && speed > upperSpeedLimit && (!bPushedAlongByCar || m_vecMoveSpeed.z < lowerSpeedLimit)
+ if (!bWasStanding && ((speed > upperSpeedLimit && !bPushedAlongByCar) || (m_vecMoveSpeed.z < lowerSpeedLimit))
&& m_pCollidingEntity != collidingEnt) {
float damage = 100.0f * Max(speed - 0.25f, 0.0f);
diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp
index e546eb05..bac82588 100644
--- a/src/weapons/Weapon.cpp
+++ b/src/weapons/Weapon.cpp
@@ -3182,7 +3182,7 @@ bool
CPed::IsPedDoingDriveByShooting(void)
{
#ifdef FIX_BUGS
- if (FindPlayerPed() == this && CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_nWeaponSlot == 5) {
+ if (FindPlayerPed() == this && CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_nWeaponSlot == WEAPONSLOT_SUBMACHINEGUN) {
#else
if (FindPlayerPed() == this && GetWeapon()->m_eWeaponType == WEAPONTYPE_UZI) {
#endif