• 🏆 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!

Trigger Leak Question

Status
Not open for further replies.
Level 3
Joined
Dec 8, 2008
Messages
29
Can anyone tell me if this trigger leaks at all? All of the (Player number of (Triggering Player)) is just an index value to make it player specific.

  • Set RushVictim[(Player number of (Triggering player))] = (Target unit of ability being cast)
  • Set RushUnit[(Player number of (Triggering player))] = (Casting unit)
  • Set RushUnitLocation[(Player number of (Triggering player))] = (Region centered at (Position of RushUnit[(Player number of (Triggering player))]) with size (200.00, 200.00))
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (RushUnitLocation[(Player number of (Triggering player))] contains RushVictim[(Player number of (Triggering player))]) Equal to False
    • Then - Actions
      • Trigger - Run Crush <gen> (ignoring conditions)
    • Else - Actions
      • Do nothing
 
Level 9
Joined
May 27, 2006
Messages
498
One leak, when you're setting your rect. You use (...) region centered at (Position of [unit variable]) (...). You should store the location of the unit to a variable previously and then remove it after setting the region.
And one tip, remove the Do nothing action, as it does the same as leaving the else actions empty, but it just uses a bit or memory.
And of course null the units, but i guess you're using those variables in the second trigger, so that the steps i mentioned are done there.

And to that 'player specific' - this is called MPI, Multiple Player Instanceable :)
 
Status
Not open for further replies.
Top