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

[Trigger] Does this leak?!

Status
Not open for further replies.
Level 12
Joined
Apr 26, 2008
Messages
830
  • Spawn 01
    • Ereignisse
      • Zeit - Every 25.00 seconds of game time
    • Bedingungen
    • Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • CreepCountR1 Kleiner als 5
        • 'THEN'-Aktionen
          • Einheit - Create 1 Soldat for Neutral feindlich at (Center of Route 1 <gen>) facing Vorgabe für Gebäude-Ausrichtung degrees
          • Set CreepCountR1 = (CreepCountR1 + 1)
          • Einheitengruppe - Add (Last created unit) to Route1Creeps
        • 'ELSE'-Aktionen
          • -------- Do nothing --------
  • Dies 01
    • Ereignisse
      • Einheit - A unit Stirbt
    • Bedingungen
      • ((Triggering unit) is in Route1Creeps) Gleich True
    • Aktionen
      • Set CreepCountR1 = (CreepCountR1 - 1)
      • Einheitengruppe - Remove (Triggering unit) from Route1Creeps


It's a simply spawn system i made for my map, i can't destroy the groups because i will still need them. So does this leak?!
 
Level 12
Joined
Apr 26, 2008
Messages
830
Another thing is that you should remove the Do Nothing. And as Maker said there is a Location leak in your Spawn01 trigger. Use CustomScript to remove the Leak:

  • Custom script: call RemoveLocation(udg_Route01)
Also it is better if you post your triggers in english and not in german.

I didn't add do nothing as function it's just a comment, and i can't post them in english since my editor is german!
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,286
It is hard to explain exactly. This is just a brief list of stupid things GUI converting to JASS does.
* stupid and/or conditional strucutres (could be written as 1 line instead).
* all tests used in if then else flow control statements broken down into dozens of separate functions (could be inlined into 1 line instead).
* heavy use of pointless function wrappers (aka, most of the Swaped and BJ functions).
* no form of optimizations or automatic code collection (storing values used multiple times in locals or creating functions for blocks of code that are refferenced multiple times throughout all triggers).

Combined with the inherit faults of GUI in the first place (no functions, no locals and obscuring useful functionality) it means GUI converted to JASS is nearly always usless and you would be better off rewriting the thing in JASS from scratch.
 
Status
Not open for further replies.
Top