Function: GetTarget(spawn)
Description: Gets the current target of the Spawn.
Parameters:
spawn(Spawn) - Spawn object representingspawn.
Returns: The selected Spawn reference, or no value (evaluates as nil) when the source or selected target is unavailable.
Selected target lifetime: The function borrows the selected actor once and transfers its custody to the active protected callback before creating Lua userdata. Reentry or collection cannot free that accepted allocation while the callback uses it. Saved userdata remains weak; a later callback cannot revive a retired actor or follow a replacement at the same address or runtime ID. See Lua actor lifetime.
Selection identity: The stored selection remembers the actor allocation chosen when the target was set. Retiring that actor and publishing another with the same runtime ID cannot redirect GetTarget before its first read. When a lookup clears an unavailable selection, it clears only the revision it observed, preserving a newer explicit selection. See Lua actor lifetime.