• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Does this tigger leak?

Status
Not open for further replies.
Level 11
Joined
Jul 17, 2013
Messages
544
I heard that it might leak, leaktester doesnt show any leaks.
  • Paris captured Copy
    • Events
      • Unit - City 0017 <gen> Changes owner
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • ((Owner of (Triggering unit)) Equal to Player 4 (Purple)) or ((Owner of (Triggering unit)) Equal to Player 9 (Gray))
    • Actions
      • Game - Display to (All players) for 15.00 seconds the text: paryz polegnie za 2...
      • Wait 20.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Triggering unit)) Equal to Player 4 (Purple)) or ((Owner of (Triggering unit)) Equal to Player 9 (Gray))
        • Then - Actions
          • Unit Group - Pick every unit in (Units in gg wal ataltycki <gen> owned by Player 10 (Light Blue)) and do (Unit - Change ownership of (Picked unit) to Player 9 (Gray) and Change color)
          • Player - Set name of Player 2 (Blue) to Vichy France
          • Unit - Kill Edouard Daladier 1319 <gen>
          • Game - Display to (All players) for 15.00 seconds the text: Paris is captured a...
          • Unit - Change ownership of City 0013 <gen> to Player 2 (Blue) and Change color
          • Unit - Change ownership of Town 0012 <gen> to Player 2 (Blue) and Change color
          • Unit - Change ownership of City 0016 <gen> to Player 9 (Gray) and Change color
          • Unit - Change ownership of City 0017 <gen> to Player 9 (Gray) and Change color
          • Unit - Change ownership of Town 0011 <gen> to Player 9 (Gray) and Change color
          • Unit - Change ownership of Town 0014 <gen> to Player 9 (Gray) and Change color
          • Unit - Change ownership of Town 0015 <gen> to Player 9 (Gray) and Change color
          • Unit - Change ownership of Town 0018 <gen> to Player 9 (Gray) and Change color
          • Unit - Change ownership of Town 2199 <gen> to Player 9 (Gray) and Change color
          • Unit - Change ownership of Town 2304 <gen> to Player 4 (Purple) and Change color
          • Unit - Change ownership of City 0019 <gen> to Player 9 (Gray) and Change color
          • Unit - Change ownership of City 2303 <gen> to Player 2 (Blue) and Change color
          • Unit - Change ownership of City 2301 <gen> to Player 2 (Blue) and Change color
          • Unit - Change ownership of City 2302 <gen> to Player 2 (Blue) and Change color
          • Player Group - Pick every player in Kathilich and do (Player - Make (Picked player) treat Player 2 (Blue) as an Enemy)
          • Player Group - Pick every player in Kathilich and do (Player - Make Player 2 (Blue) treat (Picked player) as an Enemy)
          • Player Group - Add Player 2 (Blue) to Musulm
          • Player Group - Remove Player 2 (Blue) from Kathilich
          • Player Group - Pick every player in Musulm and do (Player - Make (Picked player) treat Player 2 (Blue) as an Ally with shared vision)
          • Player Group - Pick every player in Musulm and do (Player - Make Player 2 (Blue) treat (Picked player) as an Ally with shared vision)
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Do nothing
 
Level 8
Joined
Jan 28, 2016
Messages
486
This isn't a leak but you can get rid of the
  • Do nothing
in the Else - Actions as well as it doesn't do anything. Well technically it does.
JASS:
function DoNothing takes nothing returns nothing
endfunction
...it calls an empty function, which is pointless. Thanks Blizzard! :p
 
Level 17
Joined
Dec 11, 2014
Messages
2,004
This isn't a leak but you can get rid of the
  • Do nothing
in the Else - Actions as well as it doesn't do anything. Well technically it does.
JASS:
function DoNothing takes nothing returns nothing
endfunction
...it calls an empty function, which is pointless. Thanks Blizzard! :p

At some points it's a filler function.

  • If (aBooleanThatShowIfCinematicIsSkipped Equal to (==) True) then do (Skip remaining actions) else do (Do nothing)
 
Level 8
Joined
Jan 28, 2016
Messages
486
At some points it's a filler function.

  • If (aBooleanThatShowIfCinematicIsSkipped Equal to (==) True) then do (Skip remaining actions) else do (Do nothing)

I guess but it would be more efficient to use an ITE statement with multiple actions rather than use that. The DoNothing function itself is still pointless... if you know what I mean.
 
Level 12
Joined
May 22, 2015
Messages
1,051
DoNothing causes pointless lag (very little, mind you, but it can be bad in intensive systems like knockback). It only exists for those ugly if statements (and maybe other things, but not sure what else).

You are best off replacing it with a comment saying "do nothing" or not even having an else (need to use JASS for that).

I hope this is the only place those hardcoded units get switched. I wouldn't want to have more than one of those lists anywhere if they are matching. A unit group could be set up containing those units so you don't have to copy and paste the list everywhere. It is more maintainable that way. Might not be necessary depending on how your map works.
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
Does this trigger leak?
Yes. In here
  • Unit Group - Pick every unit in (Units in gg wal ataltycki <gen> owned by Player 10 (Light Blue)) and do (Unit - Change ownership of (Picked unit) to Player 9 (Gray) and Change color)
You can fix it with something like this:
  • Set TempGroup = (Units in gg wal ataltycki <gen> owned by Player 10 (Light Blue))
  • Unit Group - Pick every unit in TempGroup and do (Actions)
    • Loop - Actions
      • Unit - Change ownership of (Picked unit) to Player 9 (Gray) and Change color
  • Custom script: call DestroyGroup(udg_TempGroup)
  • Player - Set name of Player 2 (Blue) to Vichy France
  • Unit - Kill Edouard Daladier 1319 <gen>
  • Game - Display to (All players) for 15.00 seconds the text: Paris is captured a...
  • Unit - Change ownership of City 0013 <gen> to Player 2 (Blue) and Change color
  • Unit - Change ownership of Town 0012 <gen> to Player 2 (Blue) and Change color
  • Unit - Change ownership of City 0016 <gen> to Player 9 (Gray) and Change color
  • Unit - Change ownership of City 0017 <gen> to Player 9 (Gray) and Change color
  • Unit - Change ownership of Town 0011 <gen> to Player 9 (Gray) and Change color
  • Unit - Change ownership of Town 0014 <gen> to Player 9 (Gray) and Change color
  • Unit - Change ownership of Town 0015 <gen> to Player 9 (Gray) and Change color
  • Unit - Change ownership of Town 0018 <gen> to Player 9 (Gray) and Change color
  • Unit - Change ownership of Town 2199 <gen> to Player 9 (Gray) and Change color
  • Unit - Change ownership of Town 2304 <gen> to Player 4 (Purple) and Change color
  • Unit - Change ownership of City 0019 <gen> to Player 9 (Gray) and Change color
  • Unit - Change ownership of City 2303 <gen> to Player 2 (Blue) and Change color
  • Unit - Change ownership of City 2301 <gen> to Player 2 (Blue) and Change color
  • Unit - Change ownership of City 2302 <gen> to Player 2 (Blue) and Change color
  • Player Group - Pick every player in Kathilich and do (Player - Make (Picked player) treat Player 2 (Blue) as an Enemy)
  • Player Group - Pick every player in Kathilich and do (Player - Make Player 2 (Blue) treat (Picked player) as an Enemy)
  • Player Group - Add Player 2 (Blue) to Musulm
  • Player Group - Remove Player 2 (Blue) from Kathilich
  • Player Group - Pick every player in Musulm and do (Player - Make (Picked player) treat Player 2 (Blue) as an Ally with shared vision)
  • Player Group - Pick every player in Musulm and do (Player - Make Player 2 (Blue) treat (Picked player) as an Ally with shared vision)
  • Trigger - Turn off (This trigger)
But it doesn't matter anyway since it appears this is a one-shot trigger.
 
Status
Not open for further replies.
Top