Guest User

Untitled

a guest
Sep 12th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. simulated function Projectile ProjectileFire()
  2. {
  3.     local vector        StartTrace, EndTrace, RealStartLoc, AimDir;
  4.     local ImpactInfo    TestImpact;
  5.     local Projectile    SpawnedProjectile;
  6. //  local Vector WhereTheMouseHit;
  7.     local LegendsPlayerController PC;
  8.  
  9.     // tell remote clients that we fired, to trigger effects
  10.     IncrementFlashCount();
  11.  
  12.  
  13.     if( Role == ROLE_Authority )
  14.     {
  15.  
  16.         // This is where we would start an instant trace. (what CalcWeaponFire uses)
  17.         StartTrace = Instigator.GetWeaponStartTraceLocation();
  18.    
  19.    
  20.         AimDir = Vector(GetAdjustedAim( StartTrace ));
  21.         // tu lata jak pojebane ==== AimDir = StartTrace
  22.         // this is the location where the projectile is spawned.
  23.         RealStartLoc = GetPhysicalFireStartLoc(AimDir);
  24.  
  25.         if( StartTrace != RealStartLoc )
  26.         {
  27.             // if projectile is spawned at different location of crosshair,
  28.             // then simulate an instant trace where crosshair is aiming at, Get hit info.
  29.            
  30.            
  31. /********* Ta sekcja jest uzywana gdy klasa nie ma obslugi kontrollera GRACZA i trzeba jej go wskazac **************************/  
  32.             if (Instigator != None)
  33.             {
  34.             PC = LegendsPlayerController(Instigator.Controller);
  35.                 if ( PC != None && LocalPlayer(PC.Player) != none )
  36.                 {
  37.                     EndTrace = PC.MousePosition3d;
  38.                 }
  39.             }
  40. /****************************************************************************************************************************************************/  
  41.  
  42.  
  43.             TestImpact = CalcWeaponFire( StartTrace, EndTrace );
  44.  
  45.             // Then we realign projectile aim direction to match where the crosshair did hit.
  46.             AimDir = Normal(TestImpact.HitLocation - RealStartLoc);
  47.         }
  48.  
  49.         // Spawn projectile
  50.         SpawnedProjectile = Spawn(GetProjectileClass(), Self,, RealStartLoc);
  51.         if( SpawnedProjectile != None && !SpawnedProjectile.bDeleteMe )
  52.         {
  53.             SpawnedProjectile.Init( AimDir );
  54.         }
  55.  
  56.         // Return it up the line
  57.         return SpawnedProjectile;
  58.     }
  59.  
  60.     return None;
  61. }
Add Comment
Please, Sign In to add comment