- scriptified G_PlayerFinishLevel.

Outside of SBARINFO this was the biggest remaining piece of code that referenced AInventory internals.
This commit is contained in:
Christoph Oelckers 2018-12-02 16:26:02 +01:00
commit ee08412e49
9 changed files with 168 additions and 128 deletions

View file

@ -1723,30 +1723,6 @@ void P_WriteACSVars(FSerializer &arc)
//---- Inventory functions --------------------------------------//
//
//============================================================================
//
// ClearInventory
//
// Clears the inventory for one or more actors.
//
//============================================================================
static void ClearInventory (AActor *activator)
{
if (activator == NULL)
{
for (int i = 0; i < MAXPLAYERS; ++i)
{
if (playeringame[i])
players[i].mo->ClearInventory();
}
}
else
{
activator->ClearInventory();
}
}
//============================================================================
//
// DoUseInv
@ -9218,13 +9194,13 @@ scriptwait:
break;
case PCD_CLEARINVENTORY:
ClearInventory (activator);
ScriptUtil::Exec(NAME_ClearInventory, ScriptUtil::Pointer, activator, ScriptUtil::End);
break;
case PCD_CLEARACTORINVENTORY:
if (STACK(1) == 0)
{
ClearInventory(NULL);
ScriptUtil::Exec(NAME_ClearInventory, ScriptUtil::Pointer, nullptr, ScriptUtil::End);
}
else
{
@ -9232,7 +9208,7 @@ scriptwait:
AActor *actor;
for (actor = it.Next(); actor != NULL; actor = it.Next())
{
ClearInventory(actor);
ScriptUtil::Exec(NAME_ClearInventory, ScriptUtil::Pointer, actor , ScriptUtil::End);
}
}
sp--;