aboutsummaryrefslogtreecommitdiffstats
path: root/code/pawn/component/movement/PlayerController.cs
diff options
context:
space:
mode:
Diffstat (limited to 'code/pawn/component/movement/PlayerController.cs')
-rw-r--r--code/pawn/component/movement/PlayerController.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/code/pawn/component/movement/PlayerController.cs b/code/pawn/component/movement/PlayerController.cs
index 885bf84..2c9a9b9 100644
--- a/code/pawn/component/movement/PlayerController.cs
+++ b/code/pawn/component/movement/PlayerController.cs
@@ -36,8 +36,18 @@ public class PlayerController : EntityComponent<Player>
{
if ( !Grounded )
{
- Entity.Velocity = Entity.Velocity.WithZ( 0 );
+ var zVel = Entity.Velocity.z;
AddEvent( "grounded" );
+ Entity.Velocity = Entity.Velocity.WithZ( 0 );
+
+ if (zVel < -500)
+ {
+ var damageInfo = DamageInfo.Generic( Math.Abs((float)(zVel * 0.05)) );
+ Entity.TakeDamage( damageInfo );
+ Entity.PlaySound( "fall" );
+ return;
+ }
+
}
var sprintMultiplier = TeamOperations.CanSprint( team ) ? (Input.Down( "run" ) ? 2.5f : 1f) : 1f;