GoAwayAndDie

From ZDoom Wiki
Jump to navigation Jump to search

Inventory

protected void GoAwayAndDie ()

Usage

Unlinks the calling item from world and destroys it with a delay by putting it in its HoldAndDestroy state (this state is defined in the base Inventory class).

The above only happens if the item's GoAway call returns true, signaling that this item is not supposed to respawn.

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 void GoAwayAndDie ()
	{
		if (!GoAway ())
		{
			bSpecial = false;
			if (!bNoBlockmap || !bNoSector)	// make sure that the item no longer interacts with the world for the short rest of its life.
			{
				A_ChangeLinkFlags(1, 1);
			}
			SetStateLabel("HoldAndDestroy");
		}
	}

Examples

See the TryPickup chain, for example.

See also