fixed fullauto on shotgun and rockets. fixed animation problem with 25 snaprate on hammer

This commit is contained in:
Magnus Auvinen 2007-12-18 20:33:34 +00:00
parent e988e3c161
commit 723057e8c9
2 changed files with 9 additions and 4 deletions

View file

@ -1358,6 +1358,7 @@ static void render_player(
obj_player_info info = *player_info;
float intratick = client_intratick();
float ticktime = client_ticktime();
if(player.health < 0) // dont render dead players
return;
@ -1405,12 +1406,12 @@ static void render_player(
if (player.weapon == WEAPON_HAMMER)
{
float a = clamp((client_tick()-player.attacktick+intratick)/10.0f, 0.0f, 1.0f);
float a = clamp((client_tick()-player.attacktick+ticktime)/10.0f, 0.0f, 1.0f);
anim_eval_add(&state, &data->animations[ANIM_HAMMER_SWING], a, 1.0f);
}
if (player.weapon == WEAPON_NINJA)
{
float a = clamp((client_tick()-player.attacktick+intratick)/40.0f, 0.0f, 1.0f);
float a = clamp((client_tick()-player.attacktick+ticktime)/40.0f, 0.0f, 1.0f);
anim_eval_add(&state, &data->animations[ANIM_NINJA_SWING], a, 1.0f);
}

View file

@ -920,9 +920,13 @@ int player::handle_weapons()
return handle_sniper();
*/
if(count_input(previnput.fire, input.fire).presses) //previnput.fire != input.fire && (input.fire&1))
if(reload_timer == 0)
{
if(reload_timer == 0)
bool fullauto = false;
if(active_weapon == WEAPON_ROCKET || active_weapon == WEAPON_SHOTGUN)
fullauto = true;
if(count_input(previnput.fire, input.fire).presses || (fullauto && input.fire&1))
{
// fire!
if(weapons[active_weapon].ammo)