From c0bd4e54f41acb97c3abf38bf0465a023424180c Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 1 Oct 2006 01:38:37 +0000 Subject: [PATCH] - Fixed: player_t::GetSpawnClass() always returned the spawn flags for the local player, so co-op games would spawn only the things relevant for the local player and not all the things relevant for all players. SVN r344 (trunk) --- docs/rh-log.txt | 5 +++++ src/g_shared/a_pickups.cpp | 16 ++++++++++++++-- src/p_user.cpp | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index abe2df3c49..e4ebf93708 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,8 @@ +September 30, 2006 +- Fixed: player_t::GetSpawnClass() always returned the spawn flags for the + local player, so co-op games would spawn only the things relevant for the + local player and not all the things relevant for all players. + September 30, 2006 (Changes by Graf Zahl) - Fixed: Default flags for APlayerPawn and APlayerChunk were not defined. - Fixed: The PCD_GETPLAYERINFO case in p_acs.cpp was missing a break. diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index 61ec700baa..55cfa4da70 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -1197,12 +1197,24 @@ bool AInventory::TryPickup (AActor *toucher) CCMD (printinv) { AInventory *item; + int pnum = consoleplayer; - if (players[consoleplayer].mo == NULL) +#ifdef _DEBUG + // Only allow peeking on other players' inventory in debug builds. + if (argv.argc() > 1) + { + pnum = atoi (argv[1]); + if (pnum < 0 || pnum >= MAXPLAYERS) + { + return; + } + } +#endif + if (players[pnum].mo == NULL) { return; } - for (item = players[consoleplayer].mo->Inventory; item != NULL; item = item->Inventory) + for (item = players[pnum].mo->Inventory; item != NULL; item = item->Inventory) { Printf ("%s #%u (%d/%d)\n", item->GetClass()->TypeName.GetChars(), item->InventoryID, diff --git a/src/p_user.cpp b/src/p_user.cpp index 5c35e3e06d..7f8bb8be68 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -351,7 +351,7 @@ void player_s::SetLogText (const char *text) int player_t::GetSpawnClass() { - const PClass * type = PlayerClasses[players[consoleplayer].CurrentPlayerClass].Type; + const PClass * type = PlayerClasses[CurrentPlayerClass].Type; return static_cast(GetDefaultByType(type))->SpawnMask; }