• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Just another leak question

Status
Not open for further replies.
Level 10
Joined
Jan 20, 2011
Messages
492
Hey guys, I'm currently working on a spawn system that suits my map, and it creates random units at random regions in the game. Now the problem here is I want to use locations over and over again, and I'm worried that it will leak.

Now I know leaks occur (hopefully), when you use a variable to store it, then you don't remove/destroy it, and set the same variable to another location/unit group/player group. But in my spawn system I will not be setting another location only the five I have.

Here is a little code to help understand;
  • Spawn Initiliaze
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set SpawnAmount[1] = 3
      • Set SpawnAmount[2] = 5
      • Set SpawnAmount[3] = 7
      • Set SpawnLevel1[1] = Crab
      • Set SpawnLevel1[2] = Large Crab
      • Set SpawnLevel1[3] = Makrura Prawn
      • Set SpawnLoc[1] = (Center of Event Area 1 <gen>)
      • Set SpawnLoc[2] = (Center of Event Area 2 <gen>)
      • Set SpawnLoc[3] = (Center of Event Area 3 <gen>)
      • Set SpawnLoc[4] = (Center of Event Area 4 <gen>)
      • Set SpawnLoc[5] = (Center of Event Area 5 <gen>)
  • Spawn Wave Initialize
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set RandomInt[1] = (Random integer number between 1 and 3)
      • Set RandomInt[2] = (Random integer number between 1 and 5)
      • Unit - Create SpawnAmount[1] SpawnLevel1[RandomInt[1]] for Neutral Hostile at SpawnLoc[RandomInt[2]] facing Default building facing degrees
Now will this leak, even though I'm not going to be setting my variable (SpawnLoc[]), to another location?
 
Status
Not open for further replies.
Top