- fixed: Inventory clearing after changing a level with the ACS ChangeLevel command did not properly clear the inventory. This will now use the same code as the ACS ClearInventory command.
SVN r3673 (trunk)
This commit is contained in:
parent
171066388f
commit
9c4a565366
4 changed files with 74 additions and 90 deletions
|
|
@ -1290,26 +1290,7 @@ void G_PlayerFinishLevel (int player, EFinishLevelType mode, int flags)
|
|||
// Clears the entire inventory and gives back the defaults for starting a game
|
||||
if (flags & CHANGELEVEL_RESETINVENTORY)
|
||||
{
|
||||
AInventory *inv = p->mo->Inventory;
|
||||
|
||||
while (inv != NULL)
|
||||
{
|
||||
AInventory *next = inv->Inventory;
|
||||
if (!(inv->ItemFlags & IF_UNDROPPABLE))
|
||||
{
|
||||
inv->Destroy ();
|
||||
}
|
||||
else if (inv->GetClass() == RUNTIME_CLASS(AHexenArmor))
|
||||
{
|
||||
AHexenArmor *harmor = static_cast<AHexenArmor *> (inv);
|
||||
harmor->Slots[3] = harmor->Slots[2] = harmor->Slots[1] = harmor->Slots[0] = 0;
|
||||
}
|
||||
inv = next;
|
||||
}
|
||||
p->ReadyWeapon = NULL;
|
||||
p->PendingWeapon = WP_NOCHANGE;
|
||||
p->psprites[ps_weapon].state = NULL;
|
||||
p->psprites[ps_flash].state = NULL;
|
||||
p->mo->ClearInventory();
|
||||
p->mo->GiveDefaultInventory();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue