Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- simulated function Projectile ProjectileFire()
- {
- local vector StartTrace, EndTrace, RealStartLoc, AimDir;
- local ImpactInfo TestImpact;
- local Projectile SpawnedProjectile;
- // local Vector WhereTheMouseHit;
- local LegendsPlayerController PC;
- // tell remote clients that we fired, to trigger effects
- IncrementFlashCount();
- if( Role == ROLE_Authority )
- {
- // This is where we would start an instant trace. (what CalcWeaponFire uses)
- StartTrace = Instigator.GetWeaponStartTraceLocation();
- AimDir = Vector(GetAdjustedAim( StartTrace ));
- // tu lata jak pojebane ==== AimDir = StartTrace
- // this is the location where the projectile is spawned.
- RealStartLoc = GetPhysicalFireStartLoc(AimDir);
- if( StartTrace != RealStartLoc )
- {
- // if projectile is spawned at different location of crosshair,
- // then simulate an instant trace where crosshair is aiming at, Get hit info.
- /********* Ta sekcja jest uzywana gdy klasa nie ma obslugi kontrollera GRACZA i trzeba jej go wskazac **************************/
- if (Instigator != None)
- {
- PC = LegendsPlayerController(Instigator.Controller);
- if ( PC != None && LocalPlayer(PC.Player) != none )
- {
- EndTrace = PC.MousePosition3d;
- }
- }
- /****************************************************************************************************************************************************/
- TestImpact = CalcWeaponFire( StartTrace, EndTrace );
- // Then we realign projectile aim direction to match where the crosshair did hit.
- AimDir = Normal(TestImpact.HitLocation - RealStartLoc);
- }
- // Spawn projectile
- SpawnedProjectile = Spawn(GetProjectileClass(), Self,, RealStartLoc);
- if( SpawnedProjectile != None && !SpawnedProjectile.bDeleteMe )
- {
- SpawnedProjectile.Init( AimDir );
- }
- // Return it up the line
- return SpawnedProjectile;
- }
- return None;
- }
Add Comment
Please, Sign In to add comment