• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Solved] Did I fix this location leak properly?

Status
Not open for further replies.
Level 9
Joined
Mar 2, 2014
Messages
170
  • 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?
 
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.
Back
Top