mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-30 07:41:22 +00:00
- Fixed: Morphed players did not regain their innate armor when unmorphing.
(Only Hexen has players with innate armor, under normal conditions.) SVN r504 (trunk)
This commit is contained in:
parent
b49d4333b0
commit
38c821a96e
3 changed files with 31 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
March 13, 2007
|
||||
- Fixed: Morphed players did not regain their innate armor when unmorphing.
|
||||
(Only Hexen has players with innate armor.)
|
||||
|
||||
March 12, 2007
|
||||
- Changed the default player.startitem amount from 0 to 1.
|
||||
|
||||
|
|
|
@ -87,9 +87,27 @@ bool P_MorphPlayer (player_t *p, const PClass *spawntype)
|
|||
{
|
||||
AInventory *next = item->Inventory;
|
||||
if (item->IsKindOf (RUNTIME_CLASS(AArmor)))
|
||||
{
|
||||
if (item->IsKindOf (RUNTIME_CLASS(AHexenArmor)))
|
||||
{
|
||||
// Set the HexenArmor slots to 0, except the class slot.
|
||||
AHexenArmor *hxarmor = static_cast<AHexenArmor *>(item);
|
||||
hxarmor->Slots[0] = 0;
|
||||
hxarmor->Slots[1] = 0;
|
||||
hxarmor->Slots[2] = 0;
|
||||
hxarmor->Slots[3] = 0;
|
||||
hxarmor->Slots[4] = spawntype->Meta.GetMetaFixed (APMETA_Hexenarmor0);
|
||||
}
|
||||
else if (item->ItemFlags & IF_KEEPDEPLETED)
|
||||
{
|
||||
// Set depletable armor to 0 (this includes BasicArmor).
|
||||
item->Amount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
item->Destroy ();
|
||||
}
|
||||
}
|
||||
item = next;
|
||||
}
|
||||
morphed->ActivateMorphWeapon ();
|
||||
|
@ -186,6 +204,12 @@ bool P_UndoPlayerMorph (player_t *player, bool force)
|
|||
}
|
||||
pmo->tracer = NULL;
|
||||
pmo->Destroy ();
|
||||
// Restore playerclass armor to its normal amount.
|
||||
AHexenArmor *hxarmor = mo->FindInventory<AHexenArmor>();
|
||||
if (hxarmor != NULL)
|
||||
{
|
||||
hxarmor->Slots[4] = mo->GetClass()->Meta.GetMetaFixed (APMETA_Hexenarmor0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -883,6 +883,8 @@ void AActor::CopyFriendliness (const AActor *other, bool changeTarget)
|
|||
|
||||
void AActor::ObtainInventory (AActor *other)
|
||||
{
|
||||
assert (Inventory == NULL);
|
||||
|
||||
Inventory = other->Inventory;
|
||||
InventoryID = other->InventoryID;
|
||||
other->Inventory = NULL;
|
||||
|
|
Loading…
Reference in a new issue