luorax
Invasion in Duskwood
- Reaction score
- 67
Okay, so I need a way to use static ifs in my aura module. An example:
So basically I want to avoid useless methods and method calls by using static ifs. However, static ifs run before the module itself is implemented, therefor it won't work like that. So, any ideas what should I do?
JASS:
method removeUnit takes unit u returns nothing
call GroupRemoveUnit(this.affected,u)
set thistype.stack[GetUnitUserData(u)]=thistype.stack[GetUnitUserData(u)]-1
static if thistype.unitLeave.exists then
if thistype.stack[GetUnitUserData(u)]==0
call this.unitLeave(u)
endif
endif
endmethod
So basically I want to avoid useless methods and method calls by using static ifs. However, static ifs run before the module itself is implemented, therefor it won't work like that. So, any ideas what should I do?