Prometheus
Everything is mutable; nothing is sacred
- Reaction score
- 590
Oooooohhhhh
kk, I'll remove
Edit: Changed
kk, I'll remove
Edit: Changed
People would have to be using New Gen if I used globals.first off, ur using newgen, why make all configurables which take nothing functions, as opposed to globals?
Same answer as abovesecond, again your using new gen, use a global group for your group, then no need to create a destroy one every go around
I wasn't sure if that mattered as no one I talked to could confirm it.no need to clear a group if nothing is left in it, nor before you destroy it
Instead of using a group variable just get units in range?your looping through your group is not good, you count, then grab one, just grab it and make sure its a unit
I understand this from our MSN conversation, I'll change this.no need to null your tracker, dummy or targ each loop, just in the end, and if you looped your group right, the targ would null itself (btw why you use two dummy units and move them both?)
local integer count = 1
get group
loop
set dum = FirstOfGroup(group)
exitwhen dum==null or count>what_you_want
call GroupRemoveUnit(dum)
set count = count + 1
endloop
> get groupJASS:local integer count = 1 get group loop set dum = FirstOfGroup(group) exitwhen dum==null or count>what_you_want call GroupRemoveUnit(dum) set count = count + 1 endloop
set dummy = null
set target = null
function SomeFunc takes nothing returns nothing
local unit Dummy //Notice how it's not set here
if udg_SomeBoolean then
set Dummy = CreateUnit(...)
call DoSomethingWithThis(Dummy)
call UnitApplyTimedLife(Dummy, 039;BTLF039;, 2.00)
set Dummy = null //We null it here because we know it has a value
endif
//Note how the line "set Dummy = null" is not present here
endfunction