HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Strange Bug

03-11-2009, 04:35 PM#1
xombie
Collapse JASS:
private constant function blinkDistance takes nothing returns real
    return 400.00
endfunction

...
set ux = ux + blinkDistance * Cos(radians)
set uy = uy + blinkDistance * Sin(radians)
call SetUnitX(u, ux)
call SetUnitY(u, uy)
...

For some reason this would only nudge the casting unit forward, where as the exact same code only as:

Collapse JASS:
...
set ux = ux + 400 * Cos(radians)
set uy = uy + 400 * Sin(radians)
call SetUnitX(u, ux)
call SetUnitY(u, uy)
...

Would move him the full 400.00 range. Any ideas?

Wow, okay, never mind. The reason is because "blinkDistance" is treated as an object in itself by vJass, and I forgot to add the () notifying the precompiler that I meant the contents of the function, not the function as an object (integer I'm guessing, which is why it happened to work so perfectly).

*sigh*
03-11-2009, 08:03 PM#2
Joker
shouldn't it be
Collapse JASS:
blinkDistance()
03-11-2009, 08:11 PM#3
xombie
Quote:
Originally Posted by Joker
Wow, okay, never mind. The reason is because "blinkDistance" is treated as an object in itself by vJass, and I forgot to add the () notifying the precompiler that I meant the contents of the function, not the function as an object (integer I'm guessing, which is why it happened to work so perfectly).

Read much?
03-11-2009, 08:23 PM#4
Bobo_The_Kodo
Quote:
Read much?
Put an edit: fixed at top of your thread much?
03-11-2009, 08:53 PM#5
xombie
Its not obscene to expect someone to read a question before giving an answer. Regardless of whether or not it was fixed he did not read the entire post, and thus would not have known the entire question in the first place (had it been different).
03-11-2009, 09:26 PM#6
Blacktastic
Quote:
Originally Posted by xombie
Its not obscene to expect someone to read a question before giving an answer. Regardless of whether or not it was fixed he did not read the entire post, and thus would not have known the entire question in the first place (had it been different).

Which is actually a fantastic way to see who reads an entire post and who doesn't.
03-11-2009, 10:02 PM#7
xombie
Its not a big deal, I'm not trying to take this further or anything, I was just picking fun.