I search for solutions in this order: Past Code, Unreal Source, Wiki, BUF, groups.yahoo, google, screaming at monitor. – RegularX

Legacy:Dezro/DMFix

From Unreal Wiki, The Unreal Engine Documentation Site
< Legacy:Dezro
Revision as of 10:22, 11 April 2004 by Dezro (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
class DMFix extends GameRules;
 
function PostBeginPlay()
{
	Super.PostBeginPlay();
 
	if (!Level.Game.bAllowVehicles)
		Level.Game.bAllowVehicles = true;
}
 
function bool PreventDeath(Pawn Killed, Controller Killer, class<DamageType> damageType, vector HitLocation)
{
	local Pawn Driver;
 
	if ( (NextGameRules != None) && NextGameRules.PreventDeath(Killed,Killer, damageType,HitLocation) )
		return true;
 
	if ( Vehicle(Killed)!=none && Vehicle(Killed).Driver!=none )
	{
		Driver = Vehicle(Killed).Driver;
		Vehicle(Killed).KDriverLeave(true);
		Driver.TakeDamage( max(999, Driver.Health*2), Killer.Pawn, HitLocation, VRand(), damageType);
	}
 
	return false;
}