Closed GoogleCodeExporter closed 9 years ago
This could be the reason event wasn't removed-
private static method onInit takes nothing returns nothing
call MovingUnits.event.register(Condition(function thistype.m))
call StationaryUnits.event.register(Condition(function thistype.s))
call MovementTracker.eventIndex.register(Condition(function thistype.s))
call MovementTracker.eventDeindex.register(Condition(function thistype.d))
endmethod
That is an onInit method inside of a module that was not implemented anywhere.
The reason why first wasn't removed is still a complete mystery (not used
anywhere at all).
Original comment by mrasolo...@gmail.com
on 12 Aug 2011 at 5:03
This is not a bug. Let me explain:
Optimizer remove only "optional" functions. What is optional? It's the
functions, which can't be called with ExecuteFunc (otherwise, if optimizer
delete them - map may be crashed on load). Theoretically optimizer may check
whether there are Exec with "hard" arguments like `ExecyteFunc ("some_func_" +
GetUnitAbilityLevel(u, 'A000'))`, and if it does'n - make all functions
optional. But so far it does not.
Also, executing function, which takes any arguments crashed map, so this
function can't be executed. So it optional. You also may declare function as
optional:
{{{
optional nothing a () {}
private constant optional nothing b () {}
optional function c takes nothing returns nothing
endfunction
}}}
Got it?)
Original comment by adi...@gmail.com
on 12 Aug 2011 at 8:20
People only really use ExecuteFunc for onInit tho ; \. It's not advised to use
it for anything else.
Also, if the function returns a parameter, chances are it'll never be used in
an ExecuteFunc.
Original comment by mrasolo...@gmail.com
on 12 Aug 2011 at 10:11
Original issue reported on code.google.com by
mrasolo...@gmail.com
on 12 Aug 2011 at 3:10