• 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.

What happens if I add a unit in a unit group to the same unit group again?

Status
Not open for further replies.
Level 5
Joined
May 20, 2008
Messages
138
The question is pretty self-explanatory. If I add unit A to the unit group UNITGROUP, and later add unit A to the unit group UNITGROUP again, and then use "pick every unit in UNITGROUP and do actions", will unit A be picked twice (ie the game has saved it to UNITGROUP twice)? Or will the game see it as the same unit and not add unit A to UNITGROUP again if it already has been added previously?
 
It's true what maker said,however,adding unit more than once to same unit group could cause errors,careful with that.

That's not true. Using a trigger to periodically pause a unit won't cause errors. For each action Warcraft 3 takes, before the actual action, there is a boolean that will handle the is a unit x/is not a unit x statement.
So, before the PauseUnit() action, it will firstly check if that unit is already paused, before the GroupAddUnit() action, it will firstly check if that unit is in the unit group you are adding it, before the ShowUnit() action, it will check if that unit is already hidden and so on. If such comparisons didn't exist, then bugs would come up.
 
Status
Not open for further replies.
Top