Questions about clearing hashtables/ unit groups

Status
Not open for further replies.
Level 7
Joined
Nov 19, 2015
Messages
283
Is a unit dies an effective event for clearing the child key of a hashtable?
Does a unit with an expiration timer die?
I assume unit removed from game would not count as dying??

Many of my triggers add a unit to a unit group. Is it better to create a group when it doesn't exist and then destroy it when it has no units in it.
For hashtables, would it be better to clear the parent when empty and recreate?
 
A unit removed from the game has no chance of getting the handle id from... nor anything else.

A unit dies does not always happen... for example when "Remove <unit>" is done in a trigger.

One thing that could work properly is to use a unit indexer with a proper de-index event.
However, the unit is by then already removed and you only have the index.



It is better to re-use the group every time instead of creating a new one... same for a hashtable.
 
Status
Not open for further replies.
Back
Top