HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Game thinks "or" = "and"

08-09-2008, 09:30 PM#1
Joker
Why does the game think my "or's" are "and's"?
Collapse JASS:
private function Actions takes nothing returns nothing
    local player p = GetOwningPlayer(GetTriggerUnit())
    local integer t = GetUnitTypeId(GetSpellTargetUnit())
    local integer id = GetPlayerId(p)
    
    if GetUnitTypeId(Second_Unit[id]) != t or GetUnitTypeId(Third_Unit[id]) != t or GetUnitTypeId(Fourth_Unit[id]) != t then
        set Unit[GetPlayerId(p)] = CreateUnit(p, t, 500., 0, bj_UNIT_FACING)
        call UnitRemoveAbility(GetTriggerUnit(), 'A00H')
    else
        call SimError(p, "Cannot choose the same hero twice.")
    endif
    call BJDebugMsg(I2S(t)+" =? "+I2S(GetUnitTypeId(Second_Unit[id])))
    call BJDebugMsg(I2S(t)+" =? "+I2S(GetUnitTypeId(Third_Unit[id])))
    call BJDebugMsg(I2S(t)+" =? "+I2S(GetUnitTypeId(Fourth_Unit[id])))
endfunction
The Condition returns true, unless all 3 of them are false.
08-09-2008, 09:45 PM#2
Vexorian
Quote:
The Condition returns true, unless all 3 of them are false.
Which is exactly the definition of or.
08-09-2008, 10:05 PM#3
MaD[Lion]
agreed with vex
08-09-2008, 10:24 PM#4
Joker
Shit, I feel retarded.
08-10-2008, 04:49 AM#5
DioD
you cant use OR with !=

replace != with == and swap calls (else > then)
08-10-2008, 05:35 AM#6
Vexorian
Yes he can :/
08-28-2008, 10:30 AM#7
MaD[Lion]
agreed with vex... again
08-28-2008, 12:02 PM#8
Vexorian
ok... Let me close this thread.