Merge pull request #5 from efinst0rm/patch-1

Fix for g_getplayervieworigin crash
pull/3/head
Dss0 2021-10-08 21:30:38 +02:00 committed by GitHub
commit d47007722a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 27 additions and 3 deletions

View File

@ -390,6 +390,7 @@ heliRide( lifeId, chopper )
chopper VehicleTurretControlOn( self );
self PlayerLinkWeaponviewToDelta( chopper, "tag_player", 1.0, 180, 180, 0, 180, true );
self setPlayerAngles( level.ac130 getTagAngles( "tag_player" ) );
chopper.gunner = self;
@ -1369,7 +1370,21 @@ heli_explode( altStyle )
// give "death" notify time to process
wait ( 0.05 );
self delete();
// g_getplayervieworigin fix
// we hide this helicopter then delete it
if (self.heliType == "minigun")
{
if (isDefined(self))
self hide();
wait 30;
if (isDefined(self))
self delete();
}
else
self delete();
}
@ -2043,7 +2058,16 @@ heli_leave()
// give "death" notify time to process
wait ( 0.05 );
self delete();
// g_getplayervieworigin fix
// we hide this helicopter then delete it
if (isDefined(self))
self hide();
wait 30;
if (isDefined(self))
self delete();
}
@ -2185,4 +2209,4 @@ deleteAfterTime( delay )
wait ( delay );
self delete();
}
}