[Trigger] How many times can a handle leak?

Status
Not open for further replies.
Level 10
Joined
Jan 28, 2009
Messages
442
If I want to use a function like Center of PlayableMapArea, which I understand leaks. If I want to use it several times, I don't have to destroy it, right? Or is Center of PlayableMapArea actually a new handle each time I refer to it?

Then what if I Pick all units in EmoRegion and do actions. When I refer to that handle later, some of the units might be dead or gone, and new units might be in the region now. So all units in EmoRegion is a different group now only if the contents have changed, or simply everytime referred to?
 
Level 6
Joined
Jun 4, 2009
Messages
91
  • -------- every time it is called, it create a new location. so do this --------
  • set temploc = Center of (Playable map area)
  • -------- add your own stuff here, using the variable temploc --------
  • Custom script - call RemoveLocation(udg_temploc)
 
Level 10
Joined
Jan 28, 2009
Messages
442
Okay, so dansaDisco is talking about setting a variable to the location, not calling the location many times and then cleaning the trash, but cleaning up everytime you mess a bit. Or at least, making sure you have a variable set to it until it is destroyed. Think I get it now. Thanks. And thanks for a really speedy response!
 
Level 6
Joined
Jun 4, 2009
Messages
91
the advantage with creating/destroying is that you can use the same variable in every triggers, so you won't have a hudge list if you need many different locations. But if you need only this one, you should pre-allocate once.
 
Status
Not open for further replies.
Top