GetTriggerUnit-
DogEntrepreneur
- Reaction score
- 129
^ [lJASS]GetTriggerUnit()[/lJASS]
call FogEnable(false)
call FogMaskEnable(false)
JASS:call FogEnable(false) call FogMaskEnable(false)
There's really good reasons for it (mostly to do with using them locally in melee ladder games). Not that I've ever done it..
I beg to differ; using TriggerExecute is the bigger problem if you have a [ljass]TriggerSleepAction[/ljass] call, because all associated threads will stop. Right now, I'm usuing a condition which then calls [ljass]ExecuteFunc[/ljass], and that's its only purpose (it's a dynamic trigger with a wait period inside of it).
What? I don't understand. I've never found a good reason to use ExecuteFunc. Ever. Especially since I hear Vex's map optimizer causes it to just crash.
//!
private static method retrofit takes nothing returns nothing
local unit a=GetTriggerUnit()
call retro.deallocate(retro[a])
loop
call TriggerSleepAction(0)
exitwhen (UnitAlive(a) and retro.allocate(a)!=0) or retro[a]==0
endloop
set a=null
endmethod
/**
* death -> deallocate()
*
* triggeractions crash when I reset var_onDetect;
* TriggerSleepAction does not work with triggerconditions;
* so I present to you a triggercondition just to call ExecuteFunc();
*/
private static method removeOnDeath takes nothing returns boolean
call ExecuteFunc(retrofit.name)
return false
endmethod
private static method remakeTrigger takes nothing returns nothing
local retro dat=0
// reset trigger;
call DestroyTrigger(var_onDetect)
set var_onDetect=CreateTrigger()
call TriggerAddCondition(var_onDetect,Filter(function retro.removeOnDeath))
// state-detection events need to be reset as they were destroyed with the trigger;
loop
set dat=dat.next
exitwhen dat==0
call TriggerRegisterUnitStateEvent(var_onDetect,dat.subject,UNIT_STATE_LIFE,LESS_THAN,0.405)
endloop
endmethod
double negative? Shall we tell or not?don't tell nobody.
A bug with a program I don't even use, how about just don't use a program with a stupid bug? ExecuteFunc is an important native to JASS and the fact that an optimizer breaks it just means to throw out the optimizer.
func.execute() is a waste, too, it eats the same amount of trigger/action space as if you set it up yourself, but it makes worthless duplicates of the function during compile-time (generated method executor of... generated method caller of...)
call ExecuteFunc("jasshelper__initstructs17087156")
call ExecuteFunc("AIDS__InitAIDS")
function MyF1 // ...
endfunction
function TheCodeInsideItWillBeBreakedByWc3MapOptimizer takes nothing returns nothing
local integer i = 0
call ExecuteFunc("MyF"+"1")
set i = i+1
call ExecuteFunc("MyF" + I2S(i))
endfunction