GetMaxInventory

From ZDoom Wiki
Jump to: navigation, search

int GetMaxInventory (int tid, string inventory);

Usage

Retrieves the maximum amount of the specified inventory item. If the item is present in the inventory of the actor on which to perform the check (henceforth called "reference actor"), the function retrieves the current maximum amount of that item. If, however, the item is absent from the inventory, the maximum amount of the item as defined by its actor class is retrieved, instead.

The function has a special handling for when "Health" is passed as inventory; if the reference actor is a player, it retrieves its current maximum health, otherwise it retrieves the spawn health if the actor is a non-player. This behaves exactly like GetActorProperty with APROP_SpawnHealth.

Parameters

  • tid: The tid of the reference actor. If this is 0, the check is performed on the activator of the script.
  • inventory: The inventory item to get its maximum amount.

Return value

The function returns 0 if the reference actor is non-existent, otherwise the value returned is as explained above.

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.