JASS:
if udg_Boolean[1]==true and (udg_Int[2]==26 or udg_Int[2]==27 or udg_udg_Int[2]==28 or udg_udg_Int[2]==29 or udg_udg_Int[2]==31) then
do something
endif
Issue 1: Can boolean be used with integers in the same -IF- line? (I've tested it and it seems to work as far as I understand, yet there is a warning about comparing variables with different primitive types)
Issue 2: or/and functions are supposed to leak since they return a Boolexpr. (I think Blizzard claims that Boolexpr are now fixed with the latest patch). Does someone has knowledge on this?
Should I stop using that kind of -if- formats and go with something like this?
JASS:
function Trig_Untitled_Trigger_001_Func001Func002C takes nothing returns boolean
if ( ( udg_Int[2]== 26 ) ) then
return true
endif
if ( ( udg_Int[2] == 27 ) ) then
return true
endif
if ( ( udg_Int[2] == 28 ) ) then
return true
endif
if ( ( udg_Int[2] == 29 ) ) then
return true
endif
if ( ( udg_Int[2]== 31 ) ) then
return true
endif
return false
endfunction
function Trig_Untitled_Trigger_001_Func001C takes nothing returns boolean
if ( not ( udg_Boolean[1] == true ) ) then
return false
endif
if ( not Trig_Untitled_Trigger_001_Func001Func002C() ) then
return false
endif
return true
endfunction
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
if ( Trig_Untitled_Trigger_001_Func001C() ) then
else
endif
endfunction
Which looks terrible