summaryrefslogtreecommitdiffstats
path: root/src/vehicles
diff options
context:
space:
mode:
Diffstat (limited to 'src/vehicles')
-rw-r--r--src/vehicles/Bike.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/vehicles/Bike.cpp b/src/vehicles/Bike.cpp
index 05f088bf..74dd376b 100644
--- a/src/vehicles/Bike.cpp
+++ b/src/vehicles/Bike.cpp
@@ -1351,12 +1351,7 @@ CBike::PreRender(void)
CMatrix mat;
CVector headLightPos = mi->m_positions[CAR_POS_HEADLIGHTS];
-#ifdef FIX_BUGS
- if(GetModelIndex() == MI_FAGGIO || GetModelIndex() == MI_PIZZABOY)
-#else
- if(GetModelIndex() == 152) // this is the bobcat in VC
-#endif
- {
+ if(GetModelIndex() == 152){ // this is the bobcat in VC, but we don't want that effect anyway
mat.SetUnity();
mat.RotateZ(m_fWheelAngle);
mat = m_leanMatrix * mat;
@@ -2447,16 +2442,24 @@ CBike::BurstTyre(uint8 wheel, bool applyForces)
ApplyTurnForce(GetRight() * m_fTurnMass * CGeneral::GetRandomNumberInRange(-0.02f, 0.02f), GetForward());
}
-#ifdef FIX_SIGNIFICANT_BUGS
// This code checks piece types originally so it is never triggered
// as we have converted them to wheel indices above already.
if(pDriver){
+#ifdef FIX_SIGNIFICANT_BUGS
if(wheel == BIKEWHEEL_FRONT && (m_aSuspensionSpringRatioPrev[BIKESUSP_F1] < 1.0f || m_aSuspensionSpringRatioPrev[BIKESUSP_F2] < 1.0f) ||
wheel == BIKEWHEEL_REAR && (m_aSuspensionSpringRatioPrev[BIKESUSP_R1] < 1.0f || m_aSuspensionSpringRatioPrev[BIKESUSP_R2] < 1.0f)){
+#else
+ if(wheel == CAR_PIECE_WHEEL_LF && (m_aSuspensionSpringRatioPrev[BIKESUSP_F1] < 1.0f || m_aSuspensionSpringRatioPrev[BIKESUSP_F2] < 1.0f) ||
+ wheel == CAR_PIECE_WHEEL_LR && (m_aSuspensionSpringRatioPrev[BIKESUSP_R1] < 1.0f || m_aSuspensionSpringRatioPrev[BIKESUSP_R2] < 1.0f)){
+#endif
float speedSq = m_vecMoveSpeed.MagnitudeSqr();
if(speedSq > fBikeBurstFallSpeed &&
(GetStatus() != STATUS_PLAYER || speedSq > fBikeBurstFallSpeedPlayer)){
+#ifdef FIX_SIGNIFICANT_BUGS
if(wheel == BIKEWHEEL_FRONT){
+#else
+ if(wheel == CAR_PIECE_WHEEL_LF){
+#endif
KnockOffRider(WEAPONTYPE_RAMMEDBYCAR, 0, pDriver, false);
if(pPassengers[0])
KnockOffRider(WEAPONTYPE_RAMMEDBYCAR, 0, pPassengers[0], false);
@@ -2465,7 +2468,6 @@ CBike::BurstTyre(uint8 wheel, bool applyForces)
}
}
}
-#endif
}
}
@@ -2573,7 +2575,7 @@ CBike::KnockOffRider(eWeaponType weapon, uint8 direction, CPed *ped, bool bGetBa
else if(ped->m_pedStats->m_temper <= ped->m_pedStats->m_fear &&
ped->CharCreatedBy != MISSION_CHAR && ped->m_pMyVehicle->VehicleCreatedBy != MISSION_VEHICLE &&
!CTheScripts::IsPlayerOnAMission()){
- ped->SetObjective(OBJ_47, ped->m_pMyVehicle);
+ ped->SetObjective(OBJECTIVE_WANDER, ped->m_pMyVehicle);
ped->m_nPathDir = CGeneral::GetRandomNumberInRange(0, 8);
}
}else if(ped->m_leader == nil){
@@ -2683,7 +2685,7 @@ CBike::KnockOffRider(eWeaponType weapon, uint8 direction, CPed *ped, bool bGetBa
case 3: anim = ANIM_KD_LEFT; break;
}
if(m_nWheelsOnGround == 0)
- ped->b158_4 = true;
+ ped->bKnockedOffBike = true;
break;
}
@@ -2701,7 +2703,7 @@ CBike::KnockOffRider(eWeaponType weapon, uint8 direction, CPed *ped, bool bGetBa
case 2: anim = ANIM_KO_SKID_FRONT; break;
case 3: anim = ANIM_KD_LEFT; break;
}
- ped->b158_4 = true;
+ ped->bKnockedOffBike = true;
if(ped->IsPlayer())
ped->Say(SOUND_PED_DAMAGE);
break;
@@ -2743,7 +2745,7 @@ CBike::KnockOffRider(eWeaponType weapon, uint8 direction, CPed *ped, bool bGetBa
}else
ped->GetMatrix().Translate(CVector(0.0f, 0.0f, -2.0f));
ped->m_pCollidingEntity = ped->m_pMyVehicle;
- ped->b158_4 = true;
+ ped->bKnockedOffBike = true;
ped->bHeadStuckInCollision = true;
}else if(weapon == WEAPONTYPE_RAMMEDBYCAR){
if(CWorld::TestSphereAgainstWorld(ped->GetPosition()+CVector(0.0f, 0.0, 1.3f), 0.6f, nil, true, false, false, false, false, false) == nil)