- Joined
- Sep 12, 2008
- Messages
- 657
Hey.. im working on a system that picks every unit in a group, and is added by public function called add,
everything works fine, and all.. but when the same unit is added twice, it does same effect on same unit, just twice.
for example, making him move a bit to the right, he will do that twice instead of once.
i used the IsUnitInGroup(GroupName, Unit), and for some reason. it still does it twice.. any ideas?
thanks in advance.
everything works fine, and all.. but when the same unit is added twice, it does same effect on same unit, just twice.
for example, making him move a bit to the right, he will do that twice instead of once.
i used the IsUnitInGroup(GroupName, Unit), and for some reason. it still does it twice.. any ideas?
JASS:
public function Add takes unit u, real x returns nothing
call UnitAddAbility(u, 'Amrf')
call UnitRemoveAbility(u, 'Amrf')
call MC_Actions(u)
if MC_UIGD == true then
call SetUnitFlyHeight(u, x + 50, 0)
set MC_UIGD = false
elseif MC_UIGU == true then
call SetUnitFlyHeight(u, x - 50, 0)
set MC_UIGU = false
elseif MC_UISS == true then
call SetUnitFlyHeight(u, x, 0)
set MC_UISS = false
endif
if IsUnitInGroup(u, Group) == false then
call GroupAddUnit(Group, u)
endif
endfunction
thanks in advance.