diff options
author | Roman Masanin <36927roma@gmail.com> | 2020-10-12 12:42:57 +0200 |
---|---|---|
committer | Roman Masanin <36927roma@gmail.com> | 2020-10-12 12:42:57 +0200 |
commit | 417646819c5d88bb7774bbb0341d92ada3293196 (patch) | |
tree | 4da51aa3be7f75002b16985207d9411d900dde7d /src/vehicles | |
parent | mark file and fix screen offset (diff) | |
parent | Merge pull request #753 from majesticCoding/miami (diff) | |
download | re3-417646819c5d88bb7774bbb0341d92ada3293196.tar re3-417646819c5d88bb7774bbb0341d92ada3293196.tar.gz re3-417646819c5d88bb7774bbb0341d92ada3293196.tar.bz2 re3-417646819c5d88bb7774bbb0341d92ada3293196.tar.lz re3-417646819c5d88bb7774bbb0341d92ada3293196.tar.xz re3-417646819c5d88bb7774bbb0341d92ada3293196.tar.zst re3-417646819c5d88bb7774bbb0341d92ada3293196.zip |
Diffstat (limited to 'src/vehicles')
-rw-r--r-- | src/vehicles/CarGen.cpp | 9 | ||||
-rw-r--r-- | src/vehicles/Heli.cpp | 16 | ||||
-rw-r--r-- | src/vehicles/Vehicle.cpp | 2 | ||||
-rw-r--r-- | src/vehicles/Vehicle.h | 2 |
4 files changed, 18 insertions, 11 deletions
diff --git a/src/vehicles/CarGen.cpp b/src/vehicles/CarGen.cpp index b0fa91a4..598b8342 100644 --- a/src/vehicles/CarGen.cpp +++ b/src/vehicles/CarGen.cpp @@ -28,8 +28,13 @@ uint32 CTheCarGenerators::CurrentActiveCount; void CCarGenerator::SwitchOff() { - m_nUsesRemaining = 0; - --CTheCarGenerators::CurrentActiveCount; +#ifdef FIX_BUGS + if (m_nUsesRemaining != 0) +#endif + { + m_nUsesRemaining = 0; + --CTheCarGenerators::CurrentActiveCount; + } } void CCarGenerator::SwitchOn() diff --git a/src/vehicles/Heli.cpp b/src/vehicles/Heli.cpp index a770f83d..2c2fb33c 100644 --- a/src/vehicles/Heli.cpp +++ b/src/vehicles/Heli.cpp @@ -1011,14 +1011,16 @@ CHeli::TestSniperCollision(CVector *line0, CVector *line1) bool hit = false; for(i = 0; i < NUM_HELIS; i++){ - CVector pilotPos = pHelis[i]->GetMatrix() * CVector(-0.43f, 1.49f, 1.5f); - if(pHelis[i] && !pHelis[i]->bBulletProof && CCollision::DistToLine(line0, line1, &pilotPos) < 0.8f){ - pHelis[i]->m_fAngularSpeed = CGeneral::GetRandomTrueFalse() ? 0.05f : -0.05f; - pHelis[i]->m_heliStatus = HELI_STATUS_SHOT_DOWN; - pHelis[i]->m_nExplosionTimer = CTimer::GetTimeInMilliseconds() + 9999999; - pHelis[i]->m_numSwat = 0; + if(pHelis[i] && !pHelis[i]->bBulletProof) { + CVector pilotPos = pHelis[i]->GetMatrix() * CVector(-0.43f, 1.49f, 1.5f); + if(CCollision::DistToLine(line0, line1, &pilotPos) < 0.8f){ + pHelis[i]->m_fAngularSpeed = CGeneral::GetRandomTrueFalse() ? 0.05f : -0.05f; + pHelis[i]->m_heliStatus = HELI_STATUS_SHOT_DOWN; + pHelis[i]->m_nExplosionTimer = CTimer::GetTimeInMilliseconds() + 9999999; + pHelis[i]->m_numSwat = 0; - hit = true; + hit = true; + } } } return hit; diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp index 6e86dbe4..994f3c99 100644 --- a/src/vehicles/Vehicle.cpp +++ b/src/vehicles/Vehicle.cpp @@ -1303,7 +1303,7 @@ CVehicle::InflictDamage(CEntity *damagedBy, eWeaponType weaponType, float damage } } #ifdef FIX_BUGS // removing dumb case when shooting police car in player's own garage gives wanted level - if (GetModelIndex() == MI_POLICE && damagedBy == FindPlayerPed() && !bHasBeenOwnedByPlayer) + if (GetModelIndex() == MI_POLICE && damagedBy == FindPlayerPed() && damagedBy != nil && !bHasBeenOwnedByPlayer) #else if (GetModelIndex() == MI_POLICE && damagedBy == FindPlayerPed()) #endif diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index 705fca3a..004f1fd9 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -187,7 +187,7 @@ public: CAutoPilot AutoPilot; uint8 m_currentColour1; uint8 m_currentColour2; - uint8 m_aExtras[2]; + int8 m_aExtras[2]; int16 m_nAlarmState; int16 m_nRouteSeed; CPed *pDriver; |