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

Is this leakless?

Status
Not open for further replies.
Level 8
Joined
Jun 25, 2007
Messages
165
This script are correct for leak or not (im not very good with custom scripts)
  • Computer
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
      • (Player 1 (Red) controller) Equal to Computer
    • Actions
      • Set StartLoc[1] = (Player 1 (Red) start location)
      • Melee Game - Create (Race of Player 1 (Red)) starting units for Player 1 (Red) at StartLoc[1] (Include Heroes)
      • Custom script: call RemoveLocation( udg_StartLoc[1] )
 
Level 14
Joined
Nov 4, 2006
Messages
1,241
Player Group
Note: (All Players) does not leak, and destroying it can result in problems
Player Groups leak also, but those are really rare. The fix:
  • Player Group
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Some Spell
    • Actions
      • Set PlayerGroup = (All enemies of Player 1 (Red))
      • Player Group - Pick every player in PlayerGroup and do (Do nothing)
      • Custom script: call DestroyForce(udg_PlayerGroup)
Source: http://www.hiveworkshop.com/forums/showthread.php?t=35124&highlight=what+are+leaks
 
Status
Not open for further replies.
Top