diff --git a/src/ST-Events/TriggerEndTouch.cs b/src/ST-Events/TriggerEndTouch.cs index d13c071..963401a 100644 --- a/src/ST-Events/TriggerEndTouch.cs +++ b/src/ST-Events/TriggerEndTouch.cs @@ -31,13 +31,11 @@ internal HookResult OnTriggerEndTouch(DynamicHook handler) { // Get velocities for DB queries // Get the velocity of the player - we will be using this values to compare and write to DB - float velocity = (float)Math.Sqrt(player.Controller.PlayerPawn.Value!.AbsVelocity.X * player.Controller.PlayerPawn.Value!.AbsVelocity.X - + player.Controller.PlayerPawn.Value!.AbsVelocity.Y * player.Controller.PlayerPawn.Value!.AbsVelocity.Y - + player.Controller.PlayerPawn.Value!.AbsVelocity.Z * player.Controller.PlayerPawn.Value!.AbsVelocity.Z); float velocity_x = player.Controller.PlayerPawn.Value!.AbsVelocity.X; float velocity_y = player.Controller.PlayerPawn.Value!.AbsVelocity.Y; float velocity_z = player.Controller.PlayerPawn.Value!.AbsVelocity.Z; - + float velocity = (float)Math.Sqrt(velocity_x * velocity_x + velocity_y * velocity_y + velocity_z + velocity_z); + // Map start zones -- hook into map_start, (s)tage1_start if (trigger.Entity.Name.Contains("map_start") || trigger.Entity.Name.Contains("s1_start") || diff --git a/src/ST-Events/TriggerStartTouch.cs b/src/ST-Events/TriggerStartTouch.cs index 27cffd9..0cb54a2 100644 --- a/src/ST-Events/TriggerStartTouch.cs +++ b/src/ST-Events/TriggerStartTouch.cs @@ -37,12 +37,10 @@ internal HookResult OnTriggerStartTouch(DynamicHook handler) { // Get velocities for DB queries // Get the velocity of the player - we will be using this values to compare and write to DB - float velocity = (float)Math.Sqrt(player.Controller.PlayerPawn.Value!.AbsVelocity.X * player.Controller.PlayerPawn.Value!.AbsVelocity.X - + player.Controller.PlayerPawn.Value!.AbsVelocity.Y * player.Controller.PlayerPawn.Value!.AbsVelocity.Y - + player.Controller.PlayerPawn.Value!.AbsVelocity.Z * player.Controller.PlayerPawn.Value!.AbsVelocity.Z); float velocity_x = player.Controller.PlayerPawn.Value!.AbsVelocity.X; float velocity_y = player.Controller.PlayerPawn.Value!.AbsVelocity.Y; float velocity_z = player.Controller.PlayerPawn.Value!.AbsVelocity.Z; + float velocity = (float)Math.Sqrt(velocity_x * velocity_x + velocity_y * velocity_y + velocity_z + velocity_z); // Map end zones -- hook into map_end if (trigger.Entity.Name == "map_end")