- scriptified APowerup.

This commit is contained in:
Christoph Oelckers 2017-01-17 01:50:31 +01:00
commit 75d3f42d4f
11 changed files with 304 additions and 343 deletions

View file

@ -17,6 +17,7 @@
#include "a_armor.h"
#include "r_data/sprites.h"
#include "g_levellocals.h"
#include "virtual.h"
static FRandom pr_morphmonst ("MorphMonster");
@ -597,7 +598,12 @@ void EndAllPowerupEffects(AInventory *item)
{
if (item->IsKindOf(RUNTIME_CLASS(APowerup)))
{
static_cast<APowerup *>(item)->CallEndEffect();
IFVIRTUALPTR(item, APowerup, EndEffect)
{
VMValue params[1] = { item };
VMFrameStack stack;
GlobalVMStack.Call(func, params, 1, nullptr, 0, nullptr);
}
}
item = item->Inventory;
}
@ -617,7 +623,12 @@ void InitAllPowerupEffects(AInventory *item)
{
if (item->IsKindOf(RUNTIME_CLASS(APowerup)))
{
static_cast<APowerup *>(item)->CallInitEffect();
IFVIRTUALPTR(item, APowerup, InitEffect)
{
VMValue params[1] = { item };
VMFrameStack stack;
GlobalVMStack.Call(func, params, 1, nullptr, 0, nullptr);
}
}
item = item->Inventory;
}