SineCosine
I'm still looking for my Tangent
- Reaction score
- 77
Well, a user by the name of AccName was having problems with GetUnitFacing.
His problem?
At a glance, you should be able to conclude that the following is impossible.
How can something be and not be at the same time?
So, I set out to see if it was a bug or if it was an inaccuracy.
At first, it seemed like a bug.
After all..
I used this:
And it showed me:
That's queer?
IT'S A BUG!
Nay, I say.
The answer is, === and !== should be used.
But Blizzard doesn't have those as valid comparisons..
Do they?
So..
Just how many zeroes should we put to avoid this weird bug?
I tried it and..
The answer is: Many.
32 zeroes, to be exact.
0.0000000000000000000000
So..
What's your take on this? o.0
On a side note..
Why would someone wanna' know if something is and isn't at the same time?
His problem?
JASS:
if GetUnitFacing(u) == 270.00 and GetUnitFacing(u) != 270.00 then
//Stuff
endif
At a glance, you should be able to conclude that the following is impossible.
How can something be and not be at the same time?
So, I set out to see if it was a bug or if it was an inaccuracy.
At first, it seemed like a bug.
After all..
I used this:
JASS:
library BlizzardHasPotentialBugs initializer Blizzard_Init
globals
boolean Set270 = false
endglobals
private function Test_Bug takes nothing returns nothing
local unit u = gg_unit_Hpal_0000
local real f
if Set270 == true then
call SetUnitFacingTimed(u, 270.00, 0)
endif
set f = GetUnitFacing(u)
if (f == 270.00) and (f < 270.00) then
if f <= 270.00 then
call BJDebugMsg("Unit039;s facing is either smaller than or equal to 270.00")
endif
if f >= 270.00 then
call BJDebugMsg("Unit039;s facing is either larger than or equal to 270.00")
endif
if f == 270.00 then
call BJDebugMsg("Unit039;s facing is equal to 270.00")
endif
if f != 270.00 then
call BJDebugMsg("Unit039;s facing not equal to 270.00")
endif
if f < 270.00 then
call BJDebugMsg("Unit039;s facing is smaller than 270.00")
endif
if f > 270.00 then
call BJDebugMsg("Unit039;s facing is larger than 270.00")
endif
call BJDebugMsg(R2S(GetUnitFacing(u)))
else
call BJDebugMsg("I ain039;t bugged!")
call BJDebugMsg(R2S(GetUnitFacing(u)))
endif
set u = null
endfunction
private function Stuff takes nothing returns boolean
if GetSpellAbilityId() == 039;A000039; then
if Set270 == true then
set Set270 = false
else
set Set270 = true
endif
endif
return false
endfunction
private function Blizzard_Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEvent(t, 1.00, true)
call TriggerAddAction(t, function Test_Bug)
set t = CreateTrigger()
call TriggerRegisterPlayerUnitEvent(t, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
call TriggerAddCondition(t, Condition(function Stuff))
endfunction
endlibrary
And it showed me:
Unit's facing is either smaller than or equal to 270.00
Unit's facing is equal to 270.00
Unit's facing not equal to 270.00
Unit's facing is smaller than 270.00
270.00
That's queer?
IT'S A BUG!
Nay, I say.
The answer is, === and !== should be used.
But Blizzard doesn't have those as valid comparisons..
Do they?
So..
Just how many zeroes should we put to avoid this weird bug?
I tried it and..
The answer is: Many.
32 zeroes, to be exact.
0.0000000000000000000000
So..
What's your take on this? o.0
On a side note..
Why would someone wanna' know if something is and isn't at the same time?