GoAway
Jump to navigation
Jump to search
protected bool GoAway ()
Usage
An Inventory function that is mainly used to determine if this instance of the item can be given to the player directly, or if another instance must be created. Its main purpose is to be called from CreateCopy and GoAwayAndDie.
Return value
- bool — returns true if a copy of this item must be created.
ZScript definition
Note: The ZScript definition below is for reference and may be different in the current version of GZDoom.The most up-to-date version of this code can be found on GZDoom GitHub. |
protected bool GoAway ()
{
if (IsCreatingLocalCopy())
return true;
// Dropped items never stick around
if (bDropped)
{
return false;
}
if (!ShouldStay ())
{
Hide ();
if (ShouldRespawn ())
{
return true;
}
return false;
}
return true;
}
Examples
See GoAwayAndDie.