TriggerRegisterLeaveRegion

Parameters
whichTrigger trigger

The trigger to add the event to.

whichRegion region

The region of the event.

filter boolexpr

An additional filter to determine what units will fire the trigger.

comment

Registers when a unit leaves a region.

note

Only reacts to the origin of units. Their collision sizes are not considered.

note

The filter can be null to allow any unit to fire the trigger. If there is a filter, the filter will be fired when a unit leaves the region. In this case, the trigger will only be fired if the filter returns true (a truthy value in Lua) and GetFilterUnit can be used to refer to the unit in this scope.

note

When moving a unit by trigger and causing the unit to leave the region, the filter will be fired instantly but the trigger will be fired in a deferred fashion.

note

Removing cells from the region so that units that were previously inside are now outside does not fire the trigger nor the filter. But those units will then be considered outside and can fire leave events (see TriggerRegisterEnterRegion) again when they cross the boundaries of the region.

note

When the region is destroyed, the filter and trigger will not be fired anymore.

patch

1.00

Source
common.j
return type
event
Source code
native TriggerRegisterLeaveRegion takes trigger whichTrigger, region whichRegion, boolexpr filter returns event