mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
fixed jittering when dead
This commit is contained in:
parent
0cf8d662d6
commit
dd9118573d
|
@ -1747,10 +1747,13 @@ void render_scoreboard(float x, float y, float w, int team, const char *title)
|
|||
{
|
||||
gfx_pretty_text(x+10, y, 64, title, -1);
|
||||
|
||||
char buf[128];
|
||||
sprintf(buf, "%d", gameobj->teamscore[team&1]);
|
||||
tw = gfx_pretty_text_width(64, buf, -1);
|
||||
gfx_pretty_text(x+w-tw-40, y, 64, buf, -1);
|
||||
if(gameobj)
|
||||
{
|
||||
char buf[128];
|
||||
sprintf(buf, "%d", gameobj->teamscore[team&1]);
|
||||
tw = gfx_pretty_text_width(64, buf, -1);
|
||||
gfx_pretty_text(x+w-tw-40, y, 64, buf, -1);
|
||||
}
|
||||
}
|
||||
|
||||
y += 64.0f;
|
||||
|
@ -1965,7 +1968,14 @@ void render_game()
|
|||
bool spectate = false;
|
||||
|
||||
if(config.cl_predict)
|
||||
local_character_pos = mix(predicted_prev_player.pos, predicted_player.pos, client_intrapredtick());
|
||||
{
|
||||
if(!local_character || (local_character->health < 0) || (gameobj && gameobj->game_over))
|
||||
{
|
||||
// don't use predicted
|
||||
}
|
||||
else
|
||||
local_character_pos = mix(predicted_prev_player.pos, predicted_player.pos, client_intrapredtick());
|
||||
}
|
||||
else if(local_character && local_prev_character)
|
||||
{
|
||||
local_character_pos = mix(
|
||||
|
@ -2616,7 +2626,7 @@ void render_game()
|
|||
|
||||
// render score board
|
||||
if(inp_key_pressed(KEY_TAB) || // user requested
|
||||
(!spectate && (local_character && local_character->health == -1)) || // not spectating and is dead
|
||||
(!spectate && (!local_character || local_character->health < 0)) || // not spectating and is dead
|
||||
(gameobj && gameobj->game_over) // game over
|
||||
)
|
||||
{
|
||||
|
|
|
@ -960,20 +960,6 @@ void player::tick()
|
|||
|
||||
// handle weapons
|
||||
handle_weapons();
|
||||
/*
|
||||
if (!(retflags & (MODIFIER_RETURNFLAGS_OVERRIDEVELOCITY | MODIFIER_RETURNFLAGS_OVERRIDEPOSITION)))
|
||||
{
|
||||
// add gravity
|
||||
//if (!(retflags & MODIFIER_RETURNFLAGS_OVERRIDEGRAVITY))
|
||||
//vel.y += gravity;
|
||||
|
||||
// do the move
|
||||
defered_pos = pos;
|
||||
move_box(&core.pos, &vel, vec2(phys_size, phys_size), 0);
|
||||
}*/
|
||||
|
||||
//defered_pos = core.pos;
|
||||
//jumped = core.jumped;
|
||||
|
||||
state = input.state;
|
||||
|
||||
|
@ -984,19 +970,18 @@ void player::tick()
|
|||
|
||||
void player::tick_defered()
|
||||
{
|
||||
core.move();
|
||||
core.quantize();
|
||||
//dbg_msg("", "%d %.0f,%.0f -> %.0f,%.0f", client_id, pos.x, pos.y, core.pos.x, core.pos.y);
|
||||
pos = core.pos;
|
||||
if(!dead)
|
||||
{
|
||||
core.move();
|
||||
core.quantize();
|
||||
pos = core.pos;
|
||||
}
|
||||
|
||||
if(team == -1)
|
||||
{
|
||||
pos.x = input.target_x;
|
||||
pos.y = input.target_y;
|
||||
}
|
||||
|
||||
// apply the new position
|
||||
//pos = defered_pos;
|
||||
}
|
||||
|
||||
void player::die(int killer, int weapon)
|
||||
|
|
Loading…
Reference in a new issue