[JASS] Problems with condition

Status
Not open for further replies.
Level 7
Joined
Mar 8, 2009
Messages
360
When i use

JASS:
    private function isUnitAlly2 takes nothing returns boolean
        return IsUnitOwnedByPlayer(GetFilterUnit(), Player(11)) or IsUnitOwnedByPlayer(GetFilterUnit(), Player(12))
    endfunction

it never returns true, while there are darkgreen and brown units
 
Level 7
Joined
Mar 8, 2009
Messages
360
Doesn't work :(
And this used to work pre 1.24 but now it always return true:
JASS:
private function isUnitAlly takes nothing returns boolean
    return IsUnitAlly(GetFilterUnit(), GetOwningPlayer(GetSpellTargetUnit())) and (GetFilterUnit() != GetSpellTargetUnit())
endfunction

I hope i just made a stupid mistake, i don't want all my conditions with loads of if's in it.

EDIT: There aren't waits before this is called.
 
Level 7
Joined
Mar 8, 2009
Messages
360
ok, the first one now works but the second one still returns true, also on units owned by red. I changed the second one:
JASS:
return (GetOwningPlayer(GetFilterUnit())==Player(10) or GetOwningPlayer(GetFilterUnit())==Player(11)) and (GetFilterUnit() != GetSpellTargetUnit())

BTW: ogame is boring, i played it 3 months, stopped playing, started again, played 6 months and now i stopped with it again. Top 10 players keep crashing you if you don't come online each day to fleetsave

EDIT: SOLVED, it was another stupid mistake :s, i was using a BJ that destroyed the boolexpr(which was stored in a global)

EDIT2: +rep all, btw COB, your in my map credits for you hidden resource tutorial :thumbs_up:, i like the car models :D
 
Last edited:
Status
Not open for further replies.
Top