UnMorphActor

From ZDoom Wiki
Jump to navigation Jump to search

int UnMorphActor (int tid[, bool force])

Usage

This function and its complement MorphActor give the ACS coder direct access to the engine's morph subsystem, instead of having to strategically place DECORATE items and suchlike.

Parameters

  • tid: The actor(s) to unmorph. The activator is used if this parameter is zero.
  • force: Forces the unmorph to succeed. This parameter exposes an internal engine code that bypasses the “do not unmorph in a wall” thing spawn check; it should be used with caution. For full details and additional notes, please refer to the MorphProjectile class.

Notes

This function does honor the MRF_WHENINVULNERABLE flag when used on a player in the original morphing, provided that player is also the activator of the function. In other words, you cannot force a player to be unmorphed if you are not them; otherwise, it could be used as an exploit if the morphing was originally given by a powerup.

The return value is the number of actors successfully unmorphed. This also means that for TID = 0, it is also a “boolean” (0=failed, 1=succeeded).