- Joined
- Sep 16, 2008
- Messages
- 47
So
Message shows me that there is a unit in this.DG2 group when it is in range. But when it isn't it says that there are no units in DG2 so units is not damaged once
JASS:
set this.DG = CreateGroup()
set this.DG = CreateGroup()
set this.DG2 = CreateGroup()
call GroupEnumUnitsInRange(this.DG, this.DX, this.DY, DAMAGE_RANGE, null)
loop
set this.targets = FirstOfGroup(this.DG)
exitwhen this.targets == null
if IsUnitInGroup(this.targets, this.DG2) == false then
call UnitDamageTarget(this.caster, this.targets, 25, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null)
call GroupAddUnit(this.DG2, this.targets)
endif
call GroupRemoveUnit(this.DG, this.targets)
endloop
call BJDebugMsg(I2S(CountUnitsInGroup(this.DG2)))
set this.DG = null
Message shows me that there is a unit in this.DG2 group when it is in range. But when it isn't it says that there are no units in DG2 so units is not damaged once