Jesus4Lyf
Good Idea™
- Reaction score
- 397
JASS:
private integer favouriteCallbackCount=0
private method myFavouriteCallback takes nothing returns nothing
set this.favouriteCallbackCount = this.favouriteCallbackCount + 1
call BJDebugMsg("Caster: " + GetUnitName(this.caster))
if this.favouriteCallbackCount == 3 then
call this.TU_stop(thistype.myFavouriteCallback)
set this.autoDestroy = true
endif
endmethod
private method onEffect takes nothing returns nothing
set this.autoDestroy = false
call this.TU_start(thistype.myFavouriteCallback, 1.0)
endmethod
-->
JASS:
private integer favouriteCallbackCount=0
private method myFavouriteCallback takes nothing returns nothing
set this.favouriteCallbackCount = this.favouriteCallbackCount + 1
call BJDebugMsg("Caster: " + GetUnitName(this.caster))
if this.favouriteCallbackCount == 3 then
call this.TimerStop(thistype.myFavouriteCallback)
endif
endmethod
private method onEffect takes nothing returns nothing
call this.timerStart(thistype.myFavouriteCallback, 1.0)
endmethod
Also, added .addLock and .removeLock. Timer calls will automatically lock the struct, meaning the struct cannot be destroyed while periodic functions are running on it. That is really nice.
Added .forGroup(g, method) (I forgot to do that ).
Currently 620 lines, haven't updated the post until I can test my code however.