record shields if player is invulnerable to get proper shield display in demo playback if player respawns with invulnerability on

This commit is contained in:
zicodxx 2012-04-07 16:13:10 +02:00
parent 9ca56e4039
commit d39d58a585
2 changed files with 10 additions and 13 deletions

View file

@ -6,6 +6,7 @@ main/fireball.c: made choose_drop_segment more similar to D2X-Rebirth and let fa
2d/font.c: made code more similar to D2X-Rebirth by introducing open_font which allows to keep track of font_data and free it properly 2d/font.c: made code more similar to D2X-Rebirth by introducing open_font which allows to keep track of font_data and free it properly
2d/font.c, misc/strutil.c: removed redundant definitions of FILENAME_LEN 2d/font.c, misc/strutil.c: removed redundant definitions of FILENAME_LEN
main/multi.c, main/multi.h: fixed glitch when reappear and explode packets are misordered, rendering player invisible main/multi.c, main/multi.h: fixed glitch when reappear and explode packets are misordered, rendering player invisible
main/gauges.c: record shields if player is invulnerable to get proper shield display in demo playback if player respawns with invulnerability on
20120405 20120405
-------- --------

View file

@ -2481,17 +2481,16 @@ void render_gauges()
show_bomb_count(HUD_SCALE_X(BOMB_COUNT_X), HUD_SCALE_Y(BOMB_COUNT_Y), gr_find_closest_color(0, 0, 0), 0, 0); show_bomb_count(HUD_SCALE_X(BOMB_COUNT_X), HUD_SCALE_Y(BOMB_COUNT_Y), gr_find_closest_color(0, 0, 0), 0, 0);
draw_player_ship(cloak, SHIP_GAUGE_X, SHIP_GAUGE_Y); draw_player_ship(cloak, SHIP_GAUGE_X, SHIP_GAUGE_Y);
if (Players[Player_num].flags & PLAYER_FLAGS_INVULNERABLE) { if (Players[Player_num].flags & PLAYER_FLAGS_INVULNERABLE)
draw_invulnerable_ship(); draw_invulnerable_ship();
} else { // Draw the shield gauge else
if (Newdemo_state == ND_STATE_RECORDING)
newdemo_record_player_shields(shields);
draw_shield_bar(shields); draw_shield_bar(shields);
}
draw_numerical_display(shields, energy); draw_numerical_display(shields, energy);
if (Newdemo_state == ND_STATE_RECORDING)
if (Newdemo_state==ND_STATE_RECORDING) {
newdemo_record_player_shields(shields);
newdemo_record_player_flags(Players[Player_num].flags); newdemo_record_player_flags(Players[Player_num].flags);
}
draw_keys(); draw_keys();
show_homing_warning(); show_homing_warning();
@ -2508,19 +2507,16 @@ void render_gauges()
draw_player_ship(cloak, SB_SHIP_GAUGE_X, SB_SHIP_GAUGE_Y); draw_player_ship(cloak, SB_SHIP_GAUGE_X, SB_SHIP_GAUGE_Y);
if (Players[Player_num].flags & PLAYER_FLAGS_INVULNERABLE) if (Players[Player_num].flags & PLAYER_FLAGS_INVULNERABLE)
{
draw_invulnerable_ship(); draw_invulnerable_ship();
}
else else
{ // Draw the shield gauge
if (Newdemo_state == ND_STATE_RECORDING)
newdemo_record_player_shields(shields);
sb_draw_shield_bar(shields); sb_draw_shield_bar(shields);
}
sb_draw_shield_num(shields); sb_draw_shield_num(shields);
if (Newdemo_state==ND_STATE_RECORDING) if (Newdemo_state==ND_STATE_RECORDING)
{
newdemo_record_player_shields(shields);
newdemo_record_player_flags(Players[Player_num].flags); newdemo_record_player_flags(Players[Player_num].flags);
}
sb_draw_keys(); sb_draw_keys();
sb_show_lives(); sb_show_lives();