- Joined
- Mar 23, 2007
- Messages
- 302
Hi, i have a problem with this jassy trigger
In game it says that some locations are not destroyed etc, u know, this Red Error message. Pls someone help me and say what i can improve.
I thought i removed all locations. pls someone help
(If it helps, this trigger runs every 3 seconds, i'm gonna change this to "whener unit enters playableMap")
JASS:
function Trig_set_Info_Actions takes nothing returns nothing
local group G = CreateGroup()
local group inG = CreateGroup()
local unit u
local unit inu
local location L
set G = GetUnitsInRectMatching(bj_mapInitialPlayableArea, null)
loop
set u = FirstOfGroup(G)
set L = GetUnitLoc(u)
exitwhen u == null
if ((GetUnitTypeId(u) == 'h00B')or(GetUnitTypeId(u) == 'h00A')or(GetUnitTypeId(u) == 'h00M'))then
set inG = GetUnitsInRangeOfLocAll(1000.00, L)
call RemoveLocation(L)
loop
set inu = FirstOfGroup(inG)
exitwhen inu == null
if (IsUnitType(inu,UNIT_TYPE_TOWNHALL) == true)then
call UnitAddAbility( u ,'A000')
call SetUnitAbilityLevel(u,'A000',GetUnitAbilityLevel(inu,'A000'))
endif
call GroupRemoveUnit(inG, inu)
endloop
elseif (GetUnitTypeId(u) == 'h00C')then
set inG = GetUnitsInRangeOfLocAll(600.00, L)
loop
set inu = FirstOfGroup(inG)
exitwhen inu == null
if (IsUnitType(inu,UNIT_TYPE_TOWNHALL) == true)then
call UnitAddAbility( u ,'A00V')
call SetUnitAbilityLevel(u,'A00V',GetUnitAbilityLevel(inu,'A000'))
endif
call GroupRemoveUnit(inG, inu)
endloop
endif
call GroupRemoveUnit(G, u)
endloop
call DestroyGroup(G)
call DestroyGroup(inG)
call RemoveLocation(L)
set L = null
set G = null
set inG = null
set u = null
set inu = null
endfunction
In game it says that some locations are not destroyed etc, u know, this Red Error message. Pls someone help me and say what i can improve.
I thought i removed all locations. pls someone help
(If it helps, this trigger runs every 3 seconds, i'm gonna change this to "whener unit enters playableMap")