• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Removing point leaks in conditions

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I want a trigger that fires when someone selects a unit and their hero is very close to that unit. I did the selection event, and as a condition I want to use the real comparison between triggering unit and hero. Will that cause a leak because of the "position of triggering unit" and "position of HERO"?

How do I set them to variables and delete them? Do I have to have the trigger fire every time anyone selects anything and then have an IF/THEN statement that skips it?
 

Dr Super Good

Spell Reviewer
Level 65
Joined
Jan 18, 2005
Messages
27,296
Alternativly you need not make locations at all.

Simply get their X and Y positions, make one point the orign and use good old right angle triangle maths. h^2=x^2 + y^2. This infact is faster than the GUI method cause it involves generating locations and reading the X and Y from them whereas you can read them directly.
 
Status
Not open for further replies.
Top