- scriptified PowerInfiniteAmmo to test the exported functions.

This commit is contained in:
Christoph Oelckers 2016-12-31 00:20:02 +01:00
commit 3b524cbed4
4 changed files with 60 additions and 49 deletions

View file

@ -259,7 +259,7 @@ DEFINE_ACTION_FUNCTION(APowerup, EndEffect)
void APowerup::CallEndEffect()
{
IFVIRTUAL(APowerup, InitEffect)
IFVIRTUAL(APowerup, EndEffect)
{
VMValue params[1] = { (DObject*)this };
VMFrameStack stack;
@ -1993,42 +1993,3 @@ void APowerMorph::EndEffect( )
MorphedPlayer = NULL;
}
// Infinite Ammo Powerup -----------------------------------------------------
IMPLEMENT_CLASS(APowerInfiniteAmmo, false, false)
//===========================================================================
//
// APowerInfiniteAmmo :: InitEffect
//
//===========================================================================
void APowerInfiniteAmmo::InitEffect( )
{
Super::InitEffect();
if (Owner== NULL || Owner->player == NULL)
return;
// Give the player infinite ammo
Owner->player->cheats |= CF_INFINITEAMMO;
}
//===========================================================================
//
// APowerInfiniteAmmo :: EndEffect
//
//===========================================================================
void APowerInfiniteAmmo::EndEffect( )
{
Super::EndEffect();
// Nothing to do if there's no owner.
if (Owner != NULL && Owner->player != NULL)
{
// Take away the limitless ammo
Owner->player->cheats &= ~CF_INFINITEAMMO;
}
}