Extend newdemo cloak_time hack to cover invulnerable_time

Descent demos do not record the time remaining on cloak/invulnerability,
so the demo system tries to fake it by forcing any cloaked player to
have a time remaining of 50%.  Extend that hack to do the same for
invulnerability.  The local player needs that hack.  Remote players do
not need it, but the logic is simpler with it in the loop than with a
special case for just the local player.
This commit is contained in:
Kp 2016-08-28 22:41:49 +00:00
parent 335f24ac31
commit 4e556efa1b

View file

@ -3537,11 +3537,10 @@ void newdemo_playback_one_frame()
auto &player_info = objp->ctype.player_info;
if (player_info.powerup_flags & PLAYER_FLAGS_CLOAKED)
player_info.cloak_time = GameTime64 - (CLOAK_TIME_MAX / 2);
if (player_info.powerup_flags & PLAYER_FLAGS_INVULNERABLE)
player_info.invulnerable_time = GameTime64 - (INVULNERABLE_TIME_MAX / 2);
}
if (get_local_player_flags() & PLAYER_FLAGS_INVULNERABLE)
get_local_player_invulnerable_time() = GameTime64 - (INVULNERABLE_TIME_MAX / 2);
if (Newdemo_vcr_state == ND_STATE_PAUSED) // render a frame or not
return;