- Joined
- Oct 10, 2011
- Messages
- 518
Hello everyone,
I just notice a bug (I hope it's not my warcraft 3) I have 1.33.0.19252 version of Warcraft 3 classic
when there is a comparison (superiod or equal) between 2 reals (one of them is a counter) it can't detect the 2 amounts are equals
if the amount added is lower than 0.1
here are 2 snippets of the code map joined
This will display
0.05
0.10
0.15
0.20
0.25 (the condition should be true there)
0.30 (and then the condition is true)
it does not detects that 0.25 (COUNT) is SUPERIOR OR EQUAL to 0.25 (TIMER_MAX)
it waits the next iteration to say that 0.3 (COUNT) is SUPERIOR OR EQUAL to 0.25 (TIMER_MAX)
This will display
0.10
0.20
0.30 (and then the condition is true) that is correct
I think that the equal part of the comparision ">=" does not work with decimals added if the number is lower than 0.1...
(Integer comparision works) I've noticed that bug when I launch a test from the world editor and when I launch a game normally
"<=" comparision seems to work properly
What do you think?
Does someone have the same problem?
I join a map for you to test
I just notice a bug (I hope it's not my warcraft 3) I have 1.33.0.19252 version of Warcraft 3 classic
when there is a comparison (superiod or equal) between 2 reals (one of them is a counter) it can't detect the 2 amounts are equals
if the amount added is lower than 0.1
here are 2 snippets of the code map joined
JASS:
globals
constant real INTERVAL = 0.05
constant real TIMER_MAX = 0.25
real COUNT = 0
endglobals
function Trig_Timer_Actions takes nothing returns nothing
set COUNT = COUNT + INTERVAL
call BJDebugMsg(R2S(COUNT))
if COUNT == TIMER_MAX then
call BJDebugMsg(R2S(COUNT) + " == " + R2S(TIMER_MAX))
endif
if COUNT >= TIMER_MAX then
call BJDebugMsg(R2S(COUNT) + " >= " + R2S(TIMER_MAX))
set COUNT = 0
endif
endfunction
//===========================================================================
function InitTrig_Timer takes nothing returns nothing
set gg_trg_Timer = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Timer, INTERVAL )
call TriggerAddAction( gg_trg_Timer, function Trig_Timer_Actions )
endfunction
This will display
0.05
0.10
0.15
0.20
0.25 (the condition should be true there)
0.30 (and then the condition is true)
it does not detects that 0.25 (COUNT) is SUPERIOR OR EQUAL to 0.25 (TIMER_MAX)
it waits the next iteration to say that 0.3 (COUNT) is SUPERIOR OR EQUAL to 0.25 (TIMER_MAX)
JASS:
globals
constant real INTERVAL = 0.1
constant real TIMER_MAX = 0.3
real COUNT = 0
endglobals
function Trig_Timer_Actions takes nothing returns nothing
set COUNT = COUNT + INTERVAL
call BJDebugMsg(R2S(COUNT))
if COUNT == TIMER_MAX then
call BJDebugMsg(R2S(COUNT) + " == " + R2S(TIMER_MAX))
endif
if COUNT >= TIMER_MAX then
call BJDebugMsg(R2S(COUNT) + " >= " + R2S(TIMER_MAX))
set COUNT = 0
endif
endfunction
//===========================================================================
function InitTrig_Timer takes nothing returns nothing
set gg_trg_Timer = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Timer, INTERVAL )
call TriggerAddAction( gg_trg_Timer, function Trig_Timer_Actions )
endfunction
This will display
0.10
0.20
0.30 (and then the condition is true) that is correct
I think that the equal part of the comparision ">=" does not work with decimals added if the number is lower than 0.1...
(Integer comparision works) I've noticed that bug when I launch a test from the world editor and when I launch a game normally
"<=" comparision seems to work properly
What do you think?
Does someone have the same problem?
I join a map for you to test
Attachments
Last edited: