- Duke: Remove player_struct::resurrected flag I added in 2021 and fix issue properly.

* The check for `player_struct::dead_flag` in `FinalizeInput()` was overzealous and is not checked in the original code in this instance.
This commit is contained in:
Mitchell Richters 2023-03-17 12:29:37 +11:00
parent d17650f885
commit d6b68dec5e
9 changed files with 2 additions and 12 deletions

View file

@ -66,7 +66,6 @@ static const char *cheatGod(int myconnectindex, int state)
auto* p = &ps[myconnectindex];
auto act = p->GetActor();
p->resurrected = true;
act->spr.extra = gs.max_player_health;
act->hitextra = 0;
if (ud.god)

View file

@ -2268,7 +2268,6 @@ int ParseState::parse(void)
ps[g_p].wackedbyactor = nullptr;
ps[g_p].shield_amount = gs.max_armour_amount;
ps[g_p].dead_flag = 0;
ps[g_p].resurrected = false;
ps[g_p].pals.a = 0;
ps[g_p].footprintcount = 0;
ps[g_p].weapreccnt = 0;

View file

@ -85,7 +85,6 @@ void hud_input(int plnum)
{
p->GetActor()->spr.extra += 2;
p->last_extra = p->GetActor()->spr.extra;
p->resurrected = true;
}
else if (p->GetActor()->spr.extra < gs.max_player_health)
p->GetActor()->spr.extra = gs.max_player_health;
@ -771,7 +770,7 @@ static void processVehicleInput(player_struct *p, ControlInfo* const hidInput, I
static void FinalizeInput(player_struct *p, InputPacket& input)
{
if (gamestate != GS_LEVEL || movementBlocked(p) || p->GetActor()->spr.extra <= 0 || (p->dead_flag && !ud.god && !p->resurrected))
if (gamestate != GS_LEVEL || movementBlocked(p) || p->GetActor()->spr.extra <= 0)
{
// neutralize all movement when not in a game, blocked or in automap follow mode
loc.fvel = loc.svel = 0;

View file

@ -726,7 +726,7 @@ void playerJump(int snum, double floorz, double ceilingz)
void player_struct::apply_seasick()
{
if (isRRRA() && SeaSick && (dead_flag == 0 || (dead_flag && resurrected)))
if (isRRRA() && SeaSick && (dead_flag == 0))
{
if (SeaSick < 250)
{

View file

@ -91,7 +91,6 @@ void resetplayerstats(int snum)
gFullMap = 0;
p->dead_flag = 0;
p->resurrected = false;
p->wackedbyactor = nullptr;
p->falling_counter = 0;
p->quick_kick = 0;

View file

@ -151,7 +151,6 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w,
.Array("weaprecs", w.weaprecs, w.weapreccnt)
("interface_toggle_flag", w.interface_toggle_flag)
("dead_flag", w.dead_flag)
("resurrected", w.resurrected)
("show_empty_weapon", w.show_empty_weapon)
("scuba_amount", w.scuba_amount)
("jetpack_amount", w.jetpack_amount)

View file

@ -276,8 +276,6 @@ struct player_struct
int max_secret_rooms, secret_rooms, max_actors_killed, actors_killed;
bool resurrected;
// Redneck Rampage additions. Those which did not have names in the reconstructed source got one from either RedneckGDX or RedNukem.
// Items were reordered by size.
int stairs;

View file

@ -898,7 +898,6 @@ DEFINE_FIELD_X(DukePlayer, player_struct, max_secret_rooms)
DEFINE_FIELD_X(DukePlayer, player_struct, secret_rooms)
DEFINE_FIELD_X(DukePlayer, player_struct, max_actors_killed)
DEFINE_FIELD_X(DukePlayer, player_struct, actors_killed)
DEFINE_FIELD_X(DukePlayer, player_struct, resurrected)
DEFINE_FIELD_X(DukePlayer, player_struct, stairs)
DEFINE_FIELD_X(DukePlayer, player_struct, detonate_count)
//DEFINE_FIELD_X(DukePlayer, player_struct, noise.X)

View file

@ -303,8 +303,6 @@ struct DukePlayer native
native int max_secret_rooms, secret_rooms, max_actors_killed, actors_killed;
native bool resurrected;
// Redneck Rampage additions. Those which did not have names in the reconstructed source got one from either RedneckGDX or RedNukem.
// Items were reordered by size.
native int stairs;