Legacy:Dezro/DMFix - Unreal Wiki

# Legacy:Dezro/DMFix

### From Unreal Wiki, The Unreal Engine Documentation Site

< Legacy:Dezro

    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;
    }

##### Views

- Legacy
- Discussion
- Current revision

##### Search