A_TakeFromChildren

From ZDoom Wiki
Jump to: navigation, search

int A_TakeFromChildren (string type [, int count])

Usage

Removes count items of type type from the calling actor's children's inventory. The minimum amount of item of a type in an inventory is zero, removing a greater amount than what a child actually possesses will not result in a negative amount.

An actor's children are actors which are spawned by said actor through A_SpawnItemEx with the SXF_SETMASTER flag passed to the function.

Parameters

  • type: the item to take. This should be a valid inventory item.
  • count: the number of samples of this item to take. If this is 0 or a value which is equal to or greater than the number of samples in the inventory, the item is cleared from the inventory unless it has the INVENTORY.KEEPDEPLETED flag set, and in which case, its amount is merely reduced to 0. Default is 0.

Return value

The function returns the total number of child actors which have one or more samples of type (before attempting removal) in their inventory.

Examples

Nuvolachalk.png Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contibutions are greatly appreciated.