diff options
Diffstat (limited to 'src/weapons')
-rw-r--r-- | src/weapons/Weapon.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp index 114a2240..acce142a 100644 --- a/src/weapons/Weapon.cpp +++ b/src/weapons/Weapon.cpp @@ -31,6 +31,7 @@ #include "WeaponInfo.h" #include "World.h" #include "SurfaceTable.h" +#include "Bike.h" // TODO(Miami) #define AUDIO_NOT_READY @@ -524,7 +525,22 @@ CWeapon::FireMelee(CEntity *shooter, CVector &fireSource) } damageEntityRegistered = 3; - // TODO(Miami): Bike + if (victimPed->bInVehicle) { + CVehicle *victimVeh = victimPed->m_pMyVehicle; + if (victimVeh) { + if (victimVeh->IsBike()) { + CBike *victimBike = (CBike*)victimVeh; + victimBike->KnockOffRider(m_eWeaponType, localDir, victimPed, false); + if (victimBike->pDriver) { + victimBike->pDriver->ReactToAttack(shooterPed); + } else { + if (victimVeh->pPassengers[0]) + victimVeh->pPassengers[0]->ReactToAttack(shooterPed); + } + continue; + } + } + } if ( !victimPed->DyingOrDead() ) victimPed->ReactToAttack(shooterPed); |