C
crazedcougar
Guest
local groups not correct [solved]
Hopefully you can see the problem after reading that, but heres the issue:
I give both players perfectly identical armies. I know this.
The variable redArmy only contains alive, food using, units.
The variable blueArmy contains every unit owned by udg_playerC[2]!
:nuts:
Note: Trig_vex_Actions has been pruned to only show the relevent bit. If you want to see all, I will post that.
EDIT: solved! It turns out that GetUnitsOfPlayerMatching destroys the boolxpr when its done.
Code:
function takes_food_bool takes nothing returns boolean
if ( (GetWidgetLife(GetFilterUnit()) > 0) and (GetUnitFoodUsed(GetFilterUnit()) > 0 )) then
return true
else
return false
endif
endfunction
function Trig_Untitled_Trigger_001_Func001002 takes nothing returns nothing
call DisplayTextToForce( GetPlayersAll(), GetUnitName(GetEnumUnit()) )
endfunction
function Trig_vex_Actions takes nothing returns nothing
local boolexpr b = Condition(function takes_food_bool)
local group redArmy = GetUnitsOfPlayerMatching(udg_playerC[1], b)
local group blueArmy = GetUnitsOfPlayerMatching(udg_playerC[2], b)
call ForGroupBJ( redArmy, function Trig_Untitled_Trigger_001_Func001002 )
call ForGroupBJ( blueArmy, function Trig_Untitled_Trigger_001_Func001002 )
endfunction
I give both players perfectly identical armies. I know this.
The variable redArmy only contains alive, food using, units.
The variable blueArmy contains every unit owned by udg_playerC[2]!
:nuts:
Note: Trig_vex_Actions has been pruned to only show the relevent bit. If you want to see all, I will post that.
EDIT: solved! It turns out that GetUnitsOfPlayerMatching destroys the boolxpr when its done.