|
[jass]
function GetPlayerHeroC takes nothing returns boolean
if(IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)) then
set bj_groupRandomCurrentPick=GetFilterUnit()
endif
return false
endfunction
function GetPlayerHero takes player p returns unit
local group g = CreateGroup()
local boolexpr b=Condition( function GetPlayerHeroC)
set bj_groupRandomCurrentPick=null
call GroupEnumUnitsOfPlayer(g,p,b)
call DestroyBoolExpr(b)
call DestroyGroup(g)
set b=null
set g=null
return bj_groupRandomCurrentPick
endfunction
[/jass]
不知道这个函数好不 |
|