mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Check if the turret is valid before detaching remote owner
This commit is contained in:
parent
096972827e
commit
f73e4b6f22
1 changed files with 5 additions and 2 deletions
|
@ -3691,8 +3691,11 @@ void Vehicle::DriverUse(Event *ev)
|
|||
if (slot >= 0) {
|
||||
DetachDriverSlot(slot, vec_zero, NULL);
|
||||
|
||||
if (IsSubclassOfVehicleTank() && Turrets[0].ent->IsSubclassOfVehicleTurretGun()) {
|
||||
DetachRemoteOwner();
|
||||
if (IsSubclassOfVehicleTank()) {
|
||||
// Added check to see if the turret is valid in OPM
|
||||
if (Turrets[0].ent && Turrets[0].ent->IsSubclassOfVehicleTurretGun()) {
|
||||
DetachRemoteOwner();
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue