[Andrewgosu's JASS Corner]

Status
Not open for further replies.

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
I tried it. Still nothing. Does the fact count, I have the FloatingTextBase function in the maps header?
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
Code:
function ReviveHostile takes nothing returns boolean
    return ( IsUnitEnemy(GetFilterUnit(), Player(PLAYER_NEUTRAL_AGGRESSIVE)) )
endfunction

function Trig_Revive_Dead_Hostile_Actions takes nothing returns nothing
    local unit a = GetTriggerUnit()
    local real x = GetHandleReal( a, "x" )
    local real y = GetHandleReal( a, "y" )
    local boolexpr e = Condition(function ReviveHostile)
    local group g = CreateGroup() 
    
    loop
        call PolledWait( GetRandomReal(35.00, 40.00) )
        call GroupEnumUnitsInRange( g, x, y, 1000.00, e )             
        exitwhen ( IsUnitGroupEmptyBJ(g) == true )
    endloop
    
    call DestroyBoolExpr(e) 
    call DestroyGroup(g)
    call CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), GetUnitTypeId(a), x, y, GetRandomReal(0, 360) )
    
    set a = null
    set e = null
    set g = null
endfunction

Does the boolean expression leak, if the loop checks more than 1 time? I mean, should I have to set and destroy the boolexpr in the loop or is this, what I am doing perfectly ok?
 

SFilip

Gone but not forgotten
Reaction score
633
Nope, one create - one destroy.
Blizzard even uses global variables for boolexprs as they actually never change - this is a good idea, but only possible if you have a precompiler such as JassHelper.
 
Status
Not open for further replies.
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