HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Is this efficient?

08-26-2006, 03:17 AM#1
The_AwaKening
Collapse JASS:
    set x = GetStartLocationX(GetPlayerStartLocation(heroOwner))
    set y = GetStartLocationY(GetPlayerStartLocation(heroOwner))
    set r = Rect( x - 200*0.5, y - 200*0.5, x + 200*0.5, y + 200*0.5 )
    call EnumItemsInRect(r,null,function GiveBackItems)
    set r = null

I'm just eliminating all the location calls in my map. I've never really used item groups and want to know if there is someway it needs to be cleaned up. Also, does a rect like this one need to be removed before nullified?
08-26-2006, 04:05 AM#2
SentryIII
The only thing you need to do is remove the rectangle by calling RemoveRect(r).
08-26-2006, 04:07 AM#3
Wyvernoid
200*.5=100



.0000001 sec faster it would be
08-26-2006, 04:25 AM#4
The_AwaKening
Ha, good point on the "100". Thanks both of you. Added rep.