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 = 039;B000039;
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