From f00f5d23044b770d7cebaa51c8af8bea416eabb7 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Mon, 7 Nov 2011 00:43:41 +0000 Subject: [PATCH] - Allow subclasses when checking for PowerWeaponLevel2. SVN r3314 (trunk) --- src/g_shared/a_morph.cpp | 3 ++- src/g_shared/a_weapons.cpp | 2 +- src/m_cheat.cpp | 2 +- src/p_lnspec.cpp | 2 +- src/p_pspr.cpp | 2 +- src/p_user.cpp | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/g_shared/a_morph.cpp b/src/g_shared/a_morph.cpp index e8042ac85..26fe9fd8c 100644 --- a/src/g_shared/a_morph.cpp +++ b/src/g_shared/a_morph.cpp @@ -235,7 +235,7 @@ bool P_UndoPlayerMorph (player_t *activator, player_t *player, int unmorphflag, player->MorphStyle = 0; player->MorphExitFlash = NULL; player->viewheight = mo->ViewHeight; - AInventory *level2 = mo->FindInventory (RUNTIME_CLASS(APowerWeaponLevel2)); + AInventory *level2 = mo->FindInventory (RUNTIME_CLASS(APowerWeaponLevel2), true); if (level2 != NULL) { level2->Destroy (); @@ -273,6 +273,7 @@ bool P_UndoPlayerMorph (player_t *activator, player_t *player, int unmorphflag, if ((unsigned int)player->userinfo.skin >= PlayerClasses.Size () && (size_t)player->userinfo.skin < numskins) { + skinindex = player->userinfo.skin; } else if (PlayerClasses.Size () > 1) diff --git a/src/g_shared/a_weapons.cpp b/src/g_shared/a_weapons.cpp index 3095ecbe0..6f89154bc 100644 --- a/src/g_shared/a_weapons.cpp +++ b/src/g_shared/a_weapons.cpp @@ -126,7 +126,7 @@ bool AWeapon::Use (bool pickup) // weapon, if one exists. if (SisterWeapon != NULL && SisterWeapon->WeaponFlags & WIF_POWERED_UP && - Owner->FindInventory (RUNTIME_CLASS(APowerWeaponLevel2))) + Owner->FindInventory (RUNTIME_CLASS(APowerWeaponLevel2), true)) { useweap = SisterWeapon; } diff --git a/src/m_cheat.cpp b/src/m_cheat.cpp index 0bb699f88..cf7c844b6 100644 --- a/src/m_cheat.cpp +++ b/src/m_cheat.cpp @@ -181,7 +181,7 @@ void cht_DoCheat (player_t *player, int cheat) case CHT_POWER: if (player->mo != NULL && player->health >= 0) { - item = player->mo->FindInventory (RUNTIME_CLASS(APowerWeaponLevel2)); + item = player->mo->FindInventory (RUNTIME_CLASS(APowerWeaponLevel2), true); if (item != NULL) { item->Destroy (); diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 96c9ac465..430f29bb7 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -2656,7 +2656,7 @@ FUNC(LS_SetPlayerProperty) { // Take power from activator if (power != 4) { - AInventory *item = it->FindInventory (powers[power]); + AInventory *item = it->FindInventory (powers[power], true); if (item != NULL) { item->Destroy (); diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index 2bd844788..25b23ca92 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -155,7 +155,7 @@ void P_BringUpWeapon (player_t *player) if (weapon != NULL && weapon->SisterWeapon && weapon->SisterWeapon->WeaponFlags & WIF_POWERED_UP && - player->mo->FindInventory (RUNTIME_CLASS(APowerWeaponLevel2))) + player->mo->FindInventory (RUNTIME_CLASS(APowerWeaponLevel2), true)) { weapon = weapon->SisterWeapon; } diff --git a/src/p_user.cpp b/src/p_user.cpp index 84a81d384..4c438b3da 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -672,7 +672,7 @@ AWeapon *APlayerPawn::BestWeapon (const PClass *ammotype) int bestOrder = INT_MAX; AInventory *item; AWeapon *weap; - bool tomed = NULL != FindInventory (RUNTIME_CLASS(APowerWeaponLevel2)); + bool tomed = NULL != FindInventory (RUNTIME_CLASS(APowerWeaponLevel2), true); // Find the best weapon the player has. for (item = Inventory; item != NULL; item = item->Inventory)