Skip to content

Commit

Permalink
refactor: pawn -> playerPawn
Browse files Browse the repository at this point in the history
  • Loading branch information
oscar-wos committed Nov 16, 2024
1 parent 698c236 commit 0e642f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/PlayerPawnExtends.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ namespace Zones;

public static class PlayerPawnExtends
{
public static void Bounce(this CCSPlayerPawn pawn)
public static void Bounce(this CCSPlayerPawn playerPawn)
{
var vel = new Vector(pawn.AbsVelocity.X, pawn.AbsVelocity.Y, pawn.AbsVelocity.Z);
var vel = new Vector(playerPawn.AbsVelocity.X, playerPawn.AbsVelocity.Y, playerPawn.AbsVelocity.Z);
var speed = Math.Sqrt(vel.X * vel.X + vel.Y * vel.Y);

vel *= (-350 / (float)speed);
vel.Z = vel.Z <= 0 ? 150 : Math.Min(vel.Z, 150);
pawn.Teleport(pawn.AbsOrigin, pawn.EyeAngles, vel);
playerPawn.Teleport(playerPawn.AbsOrigin, playerPawn.EyeAngles, vel);
}
}

0 comments on commit 0e642f1

Please sign in to comment.