- Joined
- Nov 30, 2007
- Messages
- 1,202
Is there any way to replace: GetUnitsSelectedAll(player) so that it can be used inside a condition scope? Currently it terminates the thread.
Edit: Solved!
JASS:
scope BugTest initializer Init
private function OnRun takes nothing returns nothing
local group g
call BJDebugMsg("Here we are")
set g = GetUnitsSelectedAll(GetTriggerPlayer())
call BJDebugMsg("Here we are not") // unreachable
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterPlayerChatEvent(t, Player(0), "-run", true )
call TriggerAddCondition(t, Condition(function OnRun))
endfunction
endscope
Edit: Solved!
JASS:
scope BugTest initializer Init
globals
group g = CreateGroup()
endglobals
private function OnRun takes nothing returns boolean
call GroupEnumUnitsSelected(g, GetTriggerPlayer(), null)
return false
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterPlayerChatEvent(t, Player(0), "-run", true )
call TriggerAddCondition(t, Condition(function OnRun))
endfunction
endscope
Last edited: