cannot convert nothing to group

Nina

New Member
Reaction score
8
Hello, this is my code and I just can't seem to find what's causing this error: cannot convert nothing to group.

JASS:

scope Warmth initializer Init
    globals
        private constant integer WarmthRatio = 5
        private constant integer WarmthBuff = 'B000'
    endglobals

    function HasBuff takes nothing returns boolean
        return ( GetUnitAbilityLevel(GetEnumUnit(), WarmthBuff) > 0)
    endfunction

    function SetDwarfWarmth takes nothing returns nothing
        if (HasBuff()) then
            set udg_Warmth[GetPlayerId(GetOwningPlayer(GetEnumUnit()))] = ( udg_Warmth[GetPlayerId(GetOwningPlayer(GetEnumUnit()))] + WarmthRatio )
        endif
    endfunction

    function Trig_Warmth_Actions takes nothing returns nothing
    local group g = CreateGroup()
    call ForGroup( GroupEnumUnitsInRect(g,bj_mapInitialPlayableArea,Filter(function True)), function SetDwarfWarmth )
    call DestroyGroup(g)
    endfunction

    //===========================================================================
    function Init takes nothing returns nothing
        local trigger t = CreateTrigger(  )
        call TriggerRegisterTimerEvent( t, 2, true )
        call TriggerAddAction( t, function Trig_Warmth_Actions )
    endfunction
endscope
 

Nina

New Member
Reaction score
8
Oh I see how did I miss that:p and I also didn't know I had to null groups after destroying them:eek:, think you could explain that? Because if it's destroyed it's not there so how can you null null?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top