Warcraft III resources & community, 2003–2006 · archived

IsRealInRange

not rated
Submitted by Xaran AlamasCalculations0 downloads
I was making triggers and suddenly thought of this condition which I'm not aware of a Blizzard.j function which does this so I made it myself :)
Basically it checks to see if a given number is within a range of two other numbers and returns a boolean. In basic terms it takes the first number then sees if that number is between the last two numbers and if it is it returns as true and if not it returns as false.
To implement it into your map simply paste the function in the code tags below in the custom script section of your map (at the top of the trigger list, the name of your map)
Hope someone else finds this handy :)

Source

function IsRealInRange takes real a, real b, real c returns boolean
     if ( ( a >= b ) and ( a <= c )) then
     return true
     else
     return false
     endif
endfunction

Comments

2
Oh ok.
The one for reals is the only needed one, because you can use integers as the arguments anyways.