diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-11-26 20:58:44 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-11-26 20:58:44 +0000 |
| commit | dd9118573d521fe6b382b1248bc7529f38bdec4f (patch) | |
| tree | c0f40a1ee3b8d0021f6e6cb53ba271af6cf37fe4 /src/game/client/game_client.cpp | |
| parent | 0cf8d662d60f9f8ff838699eef34c180a5264550 (diff) | |
| download | zcatch-dd9118573d521fe6b382b1248bc7529f38bdec4f.tar.gz zcatch-dd9118573d521fe6b382b1248bc7529f38bdec4f.zip | |
fixed jittering when dead
Diffstat (limited to 'src/game/client/game_client.cpp')
| -rw-r--r-- | src/game/client/game_client.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/game/client/game_client.cpp b/src/game/client/game_client.cpp index b7a7b8d7..8c2ff777 100644 --- a/src/game/client/game_client.cpp +++ b/src/game/client/game_client.cpp @@ -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 ) { |