home *** CD-ROM | disk | FTP | other *** search
/ Game Level Design / GLDesign.bin / Software / UnrealEngine2Runtime / UE2Runtime-22262001_Demo.exe / Engine / Classes / PotentialClimbWatcher.uc < prev    next >
Text File  |  2003-06-23  |  615b  |  34 lines

  1. class PotentialClimbWatcher extends Info
  2.     native;
  3.  
  4. simulated function Tick(float DeltaTime)
  5. {
  6.     local rotator PawnRot;
  7.     local LadderVolume L;
  8.     local bool bFound;
  9.  
  10.     if ( (Owner == None) || Owner.bDeleteMe || !Pawn(Owner).CanGrabLadder() )
  11.     {
  12.         destroy();
  13.         return;
  14.     }
  15.  
  16.     PawnRot = Owner.Rotation;
  17.     PawnRot.Pitch = 0;
  18.     ForEach Owner.TouchingActors(class'LadderVolume', L)
  19.         if ( L.Encompasses(Owner) )
  20.         {
  21.             if ( (vector(PawnRot) Dot L.LookDir) > 0.9 )
  22.             {
  23.                 Pawn(Owner).ClimbLadder(L);
  24.                 destroy();
  25.                 return;
  26.             }
  27.             else
  28.                 bFound = true;
  29.         }
  30.  
  31.     if ( !bFound )
  32.         destroy();
  33. }
  34.