- scriptified the remains of APowerup.

- ensure that actor defaults contain a valid virtual table and class pointer so that they can actually use virtual and class-dependent method functions. This is needed for retrieving script variables from them.
This commit is contained in:
Christoph Oelckers 2017-01-18 10:33:03 +01:00
commit 534b2ebbfb
15 changed files with 65 additions and 172 deletions

View file

@ -341,22 +341,11 @@ bool AInventory::Grind(bool items)
// AInventory :: DoEffect
//
// Handles any effect an item might apply to its owner
// Normally only used by subclasses of APowerup
// Normally only used by subclasses of Powerup
//
//===========================================================================
void AInventory::DoEffect ()
{
}
DEFINE_ACTION_FUNCTION(AInventory, DoEffect)
{
PARAM_SELF_PROLOGUE(AInventory);
self->DoEffect();
return 0;
}
void AInventory::CallDoEffect()
void AInventory::DoEffect()
{
IFVIRTUAL(AInventory, DoEffect)
{
@ -364,7 +353,6 @@ void AInventory::CallDoEffect()
VMFrameStack stack;
GlobalVMStack.Call(func, params, 1, nullptr, 0, nullptr);
}
else DoEffect();
}