diff --git a/source/games/duke/src/cheats.cpp b/source/games/duke/src/cheats.cpp index 95cc2a418..62ef14f90 100644 --- a/source/games/duke/src/cheats.cpp +++ b/source/games/duke/src/cheats.cpp @@ -66,7 +66,7 @@ static const char *cheatGod(int myconnectindex, int state) auto* p = &ps[myconnectindex]; auto act = p->GetActor(); - p->dead_flag = 0; + p->resurrected = true; act->s.extra = gs.max_player_health; act->extra = 0; if (ud.god) diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index 851a99a4c..b058a1f9b 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -2262,6 +2262,7 @@ 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; diff --git a/source/games/duke/src/input.cpp b/source/games/duke/src/input.cpp index 8f0cc3d7f..85f0d9f8a 100644 --- a/source/games/duke/src/input.cpp +++ b/source/games/duke/src/input.cpp @@ -84,6 +84,7 @@ void hud_input(int plnum) { p->GetActor()->s.extra += 2; p->last_extra = p->GetActor()->s.extra; + p->resurrected = true; } else if (p->GetActor()->s.extra < gs.max_player_health) p->GetActor()->s.extra = gs.max_player_health; @@ -767,7 +768,7 @@ static void processVehicleInput(player_struct *p, ControlInfo* const hidInput, I static void FinalizeInput(player_struct *p, InputPacket& input, bool vehicle) { - if (movementBlocked(p) || p->GetActor()->s.extra <= 0 || (p->dead_flag && !ud.god)) + if (movementBlocked(p) || p->GetActor()->s.extra <= 0 || (p->dead_flag && !ud.god && !p->resurrected)) { // neutralize all movement when blocked or in automap follow mode loc.fvel = loc.svel = 0; diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index 0f36b8284..11f2e157c 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -736,7 +736,7 @@ void playerJump(int snum, int fz, int cz) void player_struct::apply_seasick(double factor) { - if (isRRRA() && SeaSick && dead_flag == 0) + if (isRRRA() && SeaSick && (dead_flag == 0 || dead_flag && resurrected)) { if (SeaSick < 250) { diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index 6cb5b630a..4d72dd6a4 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -81,6 +81,7 @@ void resetplayerstats(int snum) gFullMap = 0; p->dead_flag = 0; + p->resurrected = false; p->wackedbyactor = nullptr; p->falling_counter = 0; p->quick_kick = 0; diff --git a/source/games/duke/src/savegame.cpp b/source/games/duke/src/savegame.cpp index e652d31a8..e810c25dc 100644 --- a/source/games/duke/src/savegame.cpp +++ b/source/games/duke/src/savegame.cpp @@ -161,6 +161,7 @@ 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) diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index e59a76576..681604cbd 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -244,6 +244,8 @@ 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;