diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 669f1ab0f..e5513148b 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,9 @@ +November 24, 2006 +- Fixed: When P_SpawnPlayer() calls DObject::PointerSubstitution() to + redirect player pointers, it affects the bodyque too. That meant that in + multiplayer games, once the bodyque filled up, anybody was in danger of + being rudely destroyed the next time somebody respawned. + November 22, 2006 - Added a manifest with a trustinfo section to updaterevision.exe so that the build process can run uninterrupted under Vista. diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index e19701baf..e754d79ee 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -53,6 +53,7 @@ #include "a_keys.h" #include "p_conversation.h" #include "thingdef.h" +#include "g_game.h" // MACROS ------------------------------------------------------------------ @@ -3556,6 +3557,10 @@ void P_SpawnPlayer (mapthing2_t *mthing, bool tempplayer) { assert (oldactor != NULL); DObject::PointerSubstitution (oldactor, p->mo); + // PointerSubstitution() will also affect the bodyque, so undo that now. + for (int ii=0; ii < BODYQUESIZE; ++ii) + if (bodyque[ii] == p->mo) + bodyque[ii] = oldactor; FBehavior::StaticStartTypedScripts (SCRIPT_Respawn, p->mo, true); } }