Global Group, could generate random bugs?

muzk

Member
Reaction score
3
Hello, I want to know if the following kind of code could fire random bugs in a map

JASS:
globals
    group ENUM_GROUP=CreateGroup()
endglobals

function SomeFunc takes real x,real y returns nothing
    local unit e
    call GroupEnumUnitsInRange(ENUM_GROUP,x,y,500,null)
    loop
        exitwhen e==null
        call GroupRemoveUnit(ENUM_GROUP,e)
        // Do things, like damage, cast spells to e, etc
    endloop
endfunction


I don't want to use filters that return false, because I have seen a fps test which result was looping is better (in this site) and because in filters I have to redeclare local variables (like trigger unit) using more map size.

I think it couldn't, just asking to be sure. I'm not an experienced Jasser.
 

Tom_Kazansky

--- wraith it ! ---
Reaction score
157
JASS:
globals
    group ENUM_GROUP=CreateGroup()
endglobals

function SomeFunc takes real x,real y returns nothing
    local unit e
    call GroupEnumUnitsInRange(ENUM_GROUP,x,y,500,null)
    loop
        set e = FirstOfGroup(e) // you missed this line, if you don't have this line then it will get bugged
        exitwhen e==null
        call GroupRemoveUnit(ENUM_GROUP,e)
        // Do things, like damage, cast spells to e, etc
    endloop
endfunction


using a global group like this will cause bug ONLY IF you have another "enum unit" with this ENUM_GROUP in [ljass]// Do things, like damage, cast spells to e, etc[/ljass]
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top