mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 13:01:47 +00:00
- Allow subclasses when checking for PowerWeaponLevel2.
SVN r3314 (trunk)
This commit is contained in:
parent
66f86add05
commit
f00f5d2304
6 changed files with 7 additions and 6 deletions
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 ();
|
||||
|
|
|
@ -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 ();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue