Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Rename vars
  • Loading branch information
Sergeanur committed Sep 1, 2020
1 parent 6778640 commit 3bb0e78e1c9efec3c5e7ade14271550ea2e8cf7e
Showing with 4 additions and 5 deletions.
  1. +4 −5 src/objects/Stinger.cpp
@@ -104,7 +104,7 @@ CStinger::CheckForBurstTyres()

CVehicle *vehsInRange[16];
int16 numObjects;
CEntity someEntity;
CEntity entity;

CWorld::FindObjectsInRange((lastPos + firstPos) / 2.0f,
dist, true, &numObjects, 15, (CEntity**)vehsInRange,
@@ -122,7 +122,7 @@ CStinger::CheckForBurstTyres()
if (pAutomobile == nil && pBike == nil) continue;

int wheelId = 0;
float someWheelDist = sq(((CVehicleModelInfo*)CModelInfo::GetModelInfo(vehsInRange[i]->GetModelIndex()))->m_wheelScale);
float wheelScaleSq = sq(((CVehicleModelInfo*)CModelInfo::GetModelInfo(vehsInRange[i]->GetModelIndex()))->m_wheelScale);

for (; wheelId < 4; wheelId++) {
if ((pAutomobile != nil && pAutomobile->m_aSuspensionSpringRatioPrev[wheelId] < 1.0f) ||
@@ -139,7 +139,7 @@ CStinger::CheckForBurstTyres()
vecWheelPos = pBike->m_aWheelColPoints[wheelId].point;

for (int32 spike = 0; spike < NUM_STINGER_SEGMENTS; spike++) {
if ((pSpikes[spike]->GetPosition() - vecWheelPos).Magnitude() < someWheelDist) {
if ((pSpikes[spike]->GetPosition() - vecWheelPos).Magnitude() < wheelScaleSq) {
if (pBike) {
if (wheelId < 2)
vehsInRange[i]->BurstTyre(CAR_PIECE_WHEEL_LF, true);
@@ -210,8 +210,7 @@ CStinger::Process()
angle2 = CGeneral::LimitRadianAngle(angle2);

for (int spike = 0; spike < NUM_STINGER_SEGMENTS; spike++) {
CVector somePosAgain = pos3d + CVector(pos2d.x, pos2d.y, 0.6f);
if (CWorld::TestSphereAgainstWorld(somePosAgain, 0.3f, nil, true, false, false, true, false, false))
if (CWorld::TestSphereAgainstWorld(pos3d + CVector(pos2d.x, pos2d.y, 0.6f), 0.3f, nil, true, false, false, true, false, false))
pos2d = CVector2D(0.0f, 0.0f);

if (spike % 2 == 0) {

0 comments on commit 3bb0e78

Please sign in to comment.