From 4440bff83a26f7f09f5a7eb2d96f269f7eaa5515 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 24 Nov 2018 13:08:44 +0100 Subject: [PATCH] - deleted redundant native ActivateMorphWeapon method. --- src/d_player.h | 1 - src/g_inventory/a_weapons.h | 2 -- src/p_user.cpp | 39 ------------------------------------- 3 files changed, 42 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 009af57fa1..774aba83d2 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -99,7 +99,6 @@ public: bool ResetAirSupply (bool playgasp = true); int GetMaxHealth(bool withupgrades = false) const; - void ActivateMorphWeapon (); AWeapon *PickNewWeapon (PClassActor *ammotype); AWeapon *BestWeapon (PClassActor *ammotype); void GiveDeathmatchInventory (); diff --git a/src/g_inventory/a_weapons.h b/src/g_inventory/a_weapons.h index 3f5d34dd8f..73a9d15ece 100644 --- a/src/g_inventory/a_weapons.h +++ b/src/g_inventory/a_weapons.h @@ -140,9 +140,7 @@ public: EitherFire }; bool CheckAmmo (int fireMode, bool autoSwitch, bool requireAmmo=false, int ammocount = -1); - bool DoCheckAmmo(int fireMode, bool autoSwitch, bool requireAmmo, int ammocount); bool DepleteAmmo (bool altFire, bool checkEnough=true, int ammouse = -1); - bool DoDepleteAmmo(bool altFire, bool checkEnough, int ammouse); enum { diff --git a/src/p_user.cpp b/src/p_user.cpp index de67ac55e2..3b3802cc2a 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -1503,45 +1503,6 @@ void APlayerPawn::GiveDefaultInventory () } } -void APlayerPawn::ActivateMorphWeapon () -{ - PClassActor *morphweapon = PClass::FindActor (MorphWeapon); - player->PendingWeapon = WP_NOCHANGE; - - if (player->ReadyWeapon != nullptr) - { - player->GetPSprite(PSP_WEAPON)->y = WEAPONTOP; - } - - if (morphweapon == nullptr || !morphweapon->IsDescendantOf (RUNTIME_CLASS(AWeapon))) - { // No weapon at all while morphed! - player->ReadyWeapon = nullptr; - } - else - { - player->ReadyWeapon = static_cast(player->mo->FindInventory (morphweapon)); - if (player->ReadyWeapon == nullptr) - { - player->ReadyWeapon = static_cast(player->mo->GiveInventoryType (morphweapon)); - if (player->ReadyWeapon != nullptr) - { - player->ReadyWeapon->GivenAsMorphWeapon = true; // flag is used only by new beastweap semantics in P_UndoPlayerMorph - } - } - if (player->ReadyWeapon != nullptr) - { - P_SetPsprite(player, PSP_WEAPON, player->ReadyWeapon->GetReadyState()); - } - } - - if (player->ReadyWeapon != nullptr) - { - P_SetPsprite(player, PSP_FLASH, nullptr); - } - - player->PendingWeapon = WP_NOCHANGE; -} - //=========================================================================== // // APlayerPawn :: Die