about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-10-21 18:17:50 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-10-21 18:17:50 +0000
commitd3f7de62f1b7503a7789fdc95d9fefcdeaabc305 (patch)
treeaec9fb5285fd263c4102b1813477063f91de54ca
parent8d78151d0ad759294d211156fe70281aeb4109dd (diff)
downloadzcatch-d3f7de62f1b7503a7789fdc95d9fefcdeaabc305.tar.gz
zcatch-d3f7de62f1b7503a7789fdc95d9fefcdeaabc305.zip
fixed ninja animation
-rw-r--r--src/game/client/components/players.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/game/client/components/players.cpp b/src/game/client/components/players.cpp
index 816f0293..c0488d19 100644
--- a/src/game/client/components/players.cpp
+++ b/src/game/client/components/players.cpp
@@ -118,7 +118,6 @@ void PLAYERS::render_player(
 	render_info.size = 64.0f;
 
 	float intratick = client_intratick();
-	float ticktime = client_ticktime();
 	
 	if(player.health < 0) // dont render dead players
 		return;
@@ -203,8 +202,8 @@ void PLAYERS::render_player(
 	}
 	if (player.weapon == WEAPON_NINJA)
 	{
-		float a = clamp((client_tick()-player.attacktick+ticktime)/40.0f, 0.0f, 1.0f);
-		state.add(&data->animations[ANIM_NINJA_SWING], a, 1.0f);
+		float ct = (client_prevtick()-player.attacktick)/(float)SERVER_TICK_SPEED + client_ticktime();
+		state.add(&data->animations[ANIM_NINJA_SWING], clamp(ct*2.0f,0.0f,1.0f), 1.0f);
 	}
 	
 	// do skidding