• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Can anyone tell what's the problem with the code destroying destructables?

Status
Not open for further replies.
Level 10
Joined
May 24, 2016
Messages
361
Hello, Im having a problem of trying to kill the destructables

Im out of my pc right now, but I can reproduce the way its coded.
JASS:
function SteamTankKillDestructable takes nothing returns nothing
call KillDestructable(GetEnumDestructable())
endfunction


// a timer every 0.1 second
call GroupClear(P) // SteamTanks destructable
set bj_groupAddGroupDest = P
call ForGroup(SteamTanksGroup,function GroupAddGroupEnumJ)
 // set g = CopyGroup(Paladins)
 loop
 set f = FirstOfGroup(P)
 exitwhen f == null
 set X= GetUnitX(f)
 set Y = GetUnitY(f)
 call echo(GetUnitName(f))
 set rct = Rect(X - 200, Y- 200, X+ 200, Y+ 200)
 // call echo("destroy")
 call EnumDestructablesInRect(rct, filterEnumDestructablesInCircleBJ, function SteamTankKillDestructable)
 call RemoveRect(rct)
 
 call GroupRemoveUnit(P, f)
 endloop

I already used debug and found out time that unit cycle works pretty fine so as the timer itself.
 
Status
Not open for further replies.
Back
Top