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

[Solved] Did I fix this location leak properly?

Status
Not open for further replies.
Level 9
Joined
Mar 2, 2014
Messages
160
  • Kalegos Dragonspawn
    • Events
      • Unit - Kalecgos Aspect of Magic (LB) 0413 <gen> Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Summon Dragonspawn (Kalecgos)
    • Actions
      • Set VariableSet DS = (Center of Dragonflight spawn <gen>)
      • Unit - Create 1 Blue Dragonspawn Overseer for Player 10 (Light Blue) at DS facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_DS)
      • Set VariableSet DS = (Center of Dragonflight spawn <gen>)
      • Unit - Create 2 Blue Dragonspawn Sorcerer for Player 10 (Light Blue) at DS facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_DS)
      • Set VariableSet DS = (Center of Dragonflight spawn <gen>)
      • Unit - Create 3 Blue Dragonspawn Warrior for Player 10 (Light Blue) at DS facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_DS)
      • Set VariableSet DS = (Center of Dragonflight spawn <gen>)
      • Unit - Create 3 Blue Dragonspawn Apprentice for Player 10 (Light Blue) at DS facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_DS)
      • Set VariableSet DS = (Center of Dragonflight spawn <gen>)
      • Unit - Create 3 Blue Dragonspawn Meddler for Player 10 (Light Blue) at DS facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_DS)
So now it does not leak at all right?
 
Level 29
Joined
Sep 26, 2009
Messages
2,596
yes, that does not leak, but it is kind of pointless.
The point variable is simply a set of [x,y,z] coordinates. With that in mind, it is kind of redundant to set the DS variable multiple times and clean it up if each time the DS variable points to same coordinates.

You can simplify it as this:
  • Kalegos Dragonspawn
    • Events
      • Unit - Kalecgos Aspect of Magic (LB) 0413 <gen> Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Summon Dragonspawn (Kalecgos)
    • Actions
      • Set VariableSet DS = (Center of Dragonflight spawn <gen>)
      • Unit - Create 1 Blue Dragonspawn Overseer for Player 10 (Light Blue) at DS facing Default building facing degrees
      • Unit - Create 2 Blue Dragonspawn Sorcerer for Player 10 (Light Blue) at DS facing Default building facing degrees
      • Unit - Create 3 Blue Dragonspawn Warrior for Player 10 (Light Blue) at DS facing Default building facing degrees
      • Unit - Create 3 Blue Dragonspawn Apprentice for Player 10 (Light Blue) at DS facing Default building facing degrees
      • Unit - Create 3 Blue Dragonspawn Meddler for Player 10 (Light Blue) at DS facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_DS)
 
Status
Not open for further replies.
Top