GetDistance

From ZDoom Wiki
Jump to navigation Jump to search

float GetDistance (bool checkz [, int ptr_select])

Usage

Gets the distance between the calling actor and the pointer.

Note that this function is to be used where an expression is expected. It is mostly useful when combined with A_JumpIf and can be used in place of such functions like A_JumpIfCloser.

Parameters

  • checkz: Indicates whether to factor in how high up an actor is. If false, pretends both the calling and pointed actor are both on flat ground.
  • ptr_select: the pointer to examine. Default is AAPTR_TARGET. Must be a pointer other than AAPTR_DEFAULT or AAPTR_NULL. See actor pointers.

Return value

Returns the distance in double floatation precision.

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 contributions are greatly appreciated.