Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class MutKFAntiBlocker extends Mutator;
  2.  
  3. var array<KFHumanPawn> PlayerList;
  4. var bool bUnblocked;
  5.  
  6. function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
  7. {
  8.     if (Other.IsA('KFHumanPawn'))
  9.         PlayerList[PlayerList.Length] = KFHumanPawn(Other);
  10.  
  11.     return Super.CheckReplacement(Other, bSuperRelevant);
  12. }
  13.  
  14. function Tick(float delta)
  15. {
  16.     local KFGameType KF;
  17.     local KFHumanPawn AP;
  18.  
  19.     KF = KFGameType(Level.Game);
  20.     if (KF == None) return;
  21.    
  22.     if (KF.bTradingDoorsOpen || !(KF.bTradingDoorsOpen))
  23.     {
  24.         if (!bUnblocked)
  25.         {
  26.             foreach DynamicActors(class'KFHumanPawn', AP)
  27.                 PlayerList[PlayerList.Length] = AP;
  28.             bUnblocked = true;
  29.            
  30.         }
  31.                
  32.         while (PlayerList.Length > 0) {
  33.             PlayerList[0].bBlockActors = false;
  34.             PlayerList.Remove(0, 1);
  35.         }
  36.     }
  37.     else
  38.     {
  39.         if (bUnblocked) {
  40.             foreach DynamicActors(class'KFHumanPawn', AP)
  41.                 PlayerList[PlayerList.Length] = AP;
  42.             bUnblocked = false;
  43.         }
  44.  
  45.         while (PlayerList.Length > 0) {
  46.             PlayerList[0].bBlockActors = true;
  47.             PlayerList.Remove(0, 1);
  48.         }
  49.     }
  50. }
  51.  
  52. defaultproperties
  53. {
  54.      GroupName="KF-AntiBlocker1.1"
  55.      FriendlyName="AntiBlocker 1.1"
  56.      Description="Disables player-to-player blocking during trader time."
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement