SetPointer

From ZDoom Wiki
Jump to: navigation, search

bool SetPointer(int assign_slot, int tid[, int pointer_selector[, int flags]])

Usage

Set the value of one of the caller's stored pointers.

Note: The function tests for circular reference on MASTER and TARGET fields, setting them to NULL if one is found. That test does not occur when assigning to the TRACER field. Any attempt to make the actor point directly to itself will also result in a NULL assignment.

Parameters

  • int assign_slot: An actor pointer selector. Must refer to an assignable pointer type. (Target, Master, Tracer)
  • int tid: TID of the actor to be stored in the selected slot. 0 selects the caller, but the caller can only be an intermediate selection.
  • int pointer_selector: If this is specified, the actor specified by TID is used as an intermediate actor. The final value is determined by selecting any available actor pointer from the intermediate actor.
  • int flags:
    • PTROP_UNSAFETARGET: Don't null assignments that result in an infinite chain of missiles referencing each other.
    • PTROP_UNSAFEMASTER: Don't null assignments that result in an infinite chain of actors referencing each other.

Return value

  • TRUE if a non-null assignment was made (a suitable actor was found and stored).
  • FALSE if there is no activator. This function assigns data to the activator, and cannot operate without one.
  • FALSE if a null-assignment was made.

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.


See also