- Joined
- Jun 22, 2010
- Messages
- 12
Hello Hive. Today, I made a simple trigger that ordered a unit entering a region target a point. Here's the GUI code:
I converted the trigger, made a few modifications and I thought that I'd create and remove a rect each time a unit entered it. Though after having done that, I feel as if the Jass/vJass might be improperly written as in, there might be a leak somewhere.
-
Untitled Trigger 004
-
Events
- Unit - A unit enters Region 000 <gen>
- Conditions
-
Actions
- Unit - Order (Entering unit) to Move To (Point(0.20, -2431.00))
-
Events
JASS:
scope move initializer MoveTo
private function Actions takes nothing returns nothing
call IssuePointOrderLocBJ( GetEnteringUnit(), "move", Location(0.20, -2431.00) )
endfunction
//===========================================================================
private function MoveTo takes nothing returns nothing
local trigger t = CreateTrigger( )
local rect MoveToRegion = Rect(-33.9, -796.0, 31.6, -730.9)
call TriggerRegisterEnterRectSimple(t, MoveToRegion)
call TriggerAddAction( t, function Actions )
call RemoveRect(MoveToRegion)
endfunction
endscope