- scriptified PowerInfiniteAmmo to test the exported functions.
This commit is contained in:
parent
fe0f19e1e0
commit
3b524cbed4
4 changed files with 60 additions and 49 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue