about summary refs log tree commit diff
path: root/src/game/g_game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/g_game.cpp')
-rw-r--r--src/game/g_game.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/game/g_game.cpp b/src/game/g_game.cpp
index 4befc33e..66da6295 100644
--- a/src/game/g_game.cpp
+++ b/src/game/g_game.cpp
@@ -318,13 +318,14 @@ void player_core::tick()
 			vec2 dir = normalize(pos - p->pos);
 			if(d < phys_size*1.25f && d > 1.0f)
 			{
-				float a = phys_size*1.25f - d;
+				float a = (phys_size*1.45f - d);
 				
 				// make sure that we don't add excess force by checking the
 				// direction against the current velocity
 				vec2 veldir = normalize(vel);
 				float v = 1-(dot(veldir, dir)+1)/2;
-				vel = vel + dir*a*v;
+				vel = vel + dir*a*(v*0.75f);
+				vel = vel * 0.85f;
 			}
 			
 			// handle hook influence
@@ -345,6 +346,10 @@ void player_core::tick()
 			}
 		}
 	}	
+
+	// clamp the velocity to something sane
+	if(length(vel) > 100.0f)
+		vel = normalize(vel) * 100.0f;
 }
 
 void player_core::move()