CheckMove

From ZDoom Wiki
Jump to navigation Jump to search
Note: This feature is for ZScript only.


Actor

bool CheckMove(Vector2 newpos, int flags, FCheckPosition tm)

Usage

Checks to see if the caller can successfully move to newpos in the map. Unlike TryMove, this function will not actually move the caller if the check passes.

Parameters

  • Vector2 newpos
The xy location to check. Note that this is absolute and not relative to the caller.
  • int flags
Default is 0. Multiple flags can be combined with |. The following flags are avaialble:
  • PCM_DROPOFF — Don't allow moves where the drop off exceeds the caller's MaxDropOffHeight. Actors with FLOAT or DROPOFF will ignore this.
  • PCM_NOACTORS — Ignore any actors that may be blocking the move
  • PCM_NOLINES — Ignore any lines that may be blocking the move
  • FCheckPositon tm
Default is null. A FCheckPosition struct that will be filled with the relevant information.

Return value

Returns true if the caller could successfully move to newpos.

The function also fills the values of the FCheckPosition struct, documented separately.

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.


See also