August 10, 2006 (Changes by Graf Zahl)

- Fixed: CheckActorInventory stored the return value in the wrong address
  on the ACS stack.
- Fixed: Skin sounds weren't properly restored after a SNDINFO reset.
- Added a more flexible ACS ChangeLevel function. It gets passed a level name
  instead of a level number and has several additional options (e.g. changing
  skill, starting the map without monsters and clearing the players' inventories. (UNTESTED!)
- Changed Thing_Activate so that passing a tid of 0 activates the calling actor.
- Changed Thing_Remove so that passing a tid of 0 removes the calling actor.
- Added DECORATE parameters to A_Saw.

SVN r283 (trunk)
This commit is contained in:
Christoph Oelckers 2006-08-10 15:28:12 +00:00
commit 688476b9aa
12 changed files with 175 additions and 48 deletions

View file

@ -1034,7 +1034,7 @@ void G_Ticker ()
// G_PlayerFinishLevel
// Called when a player completes a level.
//
void G_PlayerFinishLevel (int player, EFinishLevelType mode)
void G_PlayerFinishLevel (int player, EFinishLevelType mode, bool resetinventory)
{
AInventory *item, *next;
player_t *p;
@ -1102,6 +1102,32 @@ void G_PlayerFinishLevel (int player, EFinishLevelType mode)
{ // Undo morph
P_UndoPlayerMorph (p, true);
}
// Clears the entire inventory and gives back the defaults for starting a game
if (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->GiveDefaultInventory();
}
}