HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

I'm leaking dynamically created Regions

01-18-2007, 05:47 AM#1
Pyrogasm
When using GUI, there is a function about dynamically creating regions that enables you do stuff like this:
Trigger:
Set Temp_Point[5] = (Random point in (Region centered at (Position of (Casting Unit)) with size (200.00, 45.00)))
Obviously, this leaks, and I'm wondering how I would go about cleaning them. I know how to fix the point leaks, but I don't know about the region.


I have an entirely unrelated question also: lifesteal does not work like an orb effect, correct? If I were to implement an Attack detection engine, and would thus remove all existant orb effects from my map, do I have to worry about lifesteal screwing things up?
01-18-2007, 07:04 AM#2
The_AwaKening
You can convert this to gui somehow. This would be the equivalent in jass without the leak.

Collapse JASS:
 local rect r
 local real x
 local real y
    set x = GetUnitX(GetTriggerUnit())
    set y = GetUnitY(GetTriggerUnit())
    set r = Rect( x - 100, y - 22.5, x + 100, y + 22.5 )
    set udg_Temp_Point[5] = Location(GetRandomReal(GetRectMinX(r), GetRectMaxX(r)), GetRandomReal(GetRectMinY(r), GetRectMaxY(r)))
    call RemoveRect(r)
    set r = null
01-18-2007, 11:20 PM#3
Pyrogasm
Edited because of my stupidity: call RemoveRect(r) works for me; that's all I was looking for.Repp'd
Here's what I'd originally written... why, I don't know.
Last Created Rect Crap

call RemoveRect(GetLastCreatedRect()) works for me. That's all I was looking for... as long as this returns as "last created region". Repp'd



Excluding the point leaks, does centering an already existant region on a point cause a leak of any sort?

Quote:
Originally Posted by The_AwaKening
You can convert this to gui somehow.
Custom Script FTW.