• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

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