mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 13:11:33 +00:00
- fixed: "take armor" cheat should only deplete the armor, not destroy it.
- fixed: Hexen armor cannot be depleted by the common function, it needs an override to achieve that.
This commit is contained in:
parent
8ba6f6ced5
commit
21c55a090a
3 changed files with 12 additions and 3 deletions
|
@ -550,3 +550,11 @@ void AHexenArmor::AbsorbDamage (int damage, FName damageType, int &newdamage)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void AHexenArmor::DepleteOrDestroy()
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
Slots[i] = 0;
|
||||
}
|
||||
}
|
|
@ -508,6 +508,7 @@ public:
|
|||
virtual AInventory *CreateTossable ();
|
||||
virtual bool HandlePickup (AInventory *item);
|
||||
virtual void AbsorbDamage (int damage, FName damageType, int &newdamage);
|
||||
void DepleteOrDestroy();
|
||||
|
||||
fixed_t Slots[5];
|
||||
fixed_t SlotsIncrement[4];
|
||||
|
|
|
@ -927,7 +927,7 @@ void cht_Take (player_t *player, const char *name, int amount)
|
|||
AInventory *ammo = player->mo->FindInventory(static_cast<PClassActor *>(type));
|
||||
|
||||
if (ammo)
|
||||
ammo->Amount = 0;
|
||||
ammo->DepleteOrDestroy();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -943,10 +943,10 @@ void cht_Take (player_t *player, const char *name, int amount)
|
|||
|
||||
if (type->IsDescendantOf (RUNTIME_CLASS (AArmor)))
|
||||
{
|
||||
AActor *armor = player->mo->FindInventory(static_cast<PClassActor *>(type));
|
||||
AInventory *armor = player->mo->FindInventory(static_cast<PClassActor *>(type));
|
||||
|
||||
if (armor)
|
||||
armor->Destroy ();
|
||||
armor->DepleteOrDestroy();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue