• 🏆 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 leak?

Status
Not open for further replies.
Level 7
Joined
Apr 7, 2009
Messages
241
Does this leak?
  • Events
    • Unit - A unit owned by Player 12 (Brown) Dies
  • Conditions
  • Actions
    • Set RandomInteger = (Random integer number between 1 and 100)
    • If ((RandomInteger Less than or equal to 1) and ((Unit-type of (Triggering unit)) Equal to Furbolg Youngling)) then do (Item - Create Buckler at (Position of (Triggering unit))) else do (Do nothing)
    • If ((RandomInteger Less than or equal to 1) and ((Unit-type of (Triggering unit)) Equal to Wolf)) then do (Item - Create Wooden Staff at (Position of (Triggering unit))) else do (Do nothing)
    • If ((RandomInteger Less than or equal to 1) and ((Unit-type of (Triggering unit)) Equal to Dire Wolf)) then do (Item - Create Wolf Cap at (Position of (Triggering unit))) else do (Do nothing)
    • If ((RandomInteger Less than or equal to 5) and ((Unit-type of (Triggering unit)) Equal to Goreclaw)) then do (Item - Create Buckler at (Position of (Triggering unit))) else do (Do nothing)
    • If ((RandomInteger Less than or equal to 1) and ((Unit-type of (Triggering unit)) Equal to Pirate)) then do (Item - Create Axe at (Position of (Triggering unit))) else do (Do nothing)
    • If ((RandomInteger Less than or equal to 1) and ((Unit-type of (Triggering unit)) Equal to Pirate Elite)) then do (Item - Create Steelsword at (Position of (Triggering unit))) else do (Do nothing)
    • If ((RandomInteger Less than or equal to 1) and ((Unit-type of (Triggering unit)) Equal to Outlaw)) then do (Item - Create Wooden Club at (Position of (Triggering unit))) else do (Do nothing)
    • If ((RandomInteger Less than or equal to 1) and ((Unit-type of (Triggering unit)) Equal to Outlaw Ruffian)) then do (Item - Create Wooden Club at (Position of (Triggering unit))) else do (Do nothing)
 
Do this instead:

  • Events
    • Unit - A unit owned by Player 12 (Brown) Dies
  • Conditions
  • Actions
    • Set RandomInteger = (Random integer number between 1 and 100)
    • Set pt = (Position of (Triggering Unit))
    • If ((RandomInteger Less than 6)) then do
      • Then - Actions
        • ((Unit-type of (Triggering unit)) Equal to Goreclaw)) then do (Item - Create Buckler at (pt) else do (Do nothing)
        • If ((RandomInteger equal to 1)) then do
          • Then - Actions
            • -------- Do the following for the rest of the kills --------
            • If ((Unit-type of (Triggering unit)) Equal to blah blah)) then do (Item - Create blah blah at (pt) else do (Do nothing)
          • Else - Actions
      • Else - Actions
    • Custom script: call RemoveLocation (udg_pt)
This will save you memory leaks and will cut down a little on the filesize of your map.
 
Last edited:
Status
Not open for further replies.
Top