HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

filter and booleans

10-01-2007, 01:11 AM#1
sinners_la_b
I havnt had much practice with using booleans so could some one tell me why this doesnt work. Its meant to heal only allied units of the caster however it doesnt heal anything heres my filter:

Collapse JASS:
return IsUnitAlly(GetFilterUnit(), GetOwningPlayer(caster)) == true and IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(caster)) == true


Thanks for the help
10-01-2007, 02:32 AM#2
Av3n
Wel maybe remove IsUnitEnemy part see what happens. and remove ==true as well

-Av3n
10-01-2007, 03:55 AM#3
sinners_la_b
didnt work unfortunetly anything else i could try? I think i have tried every combination of true and false with all the different functions possible lol

Thanks
10-01-2007, 06:05 AM#4
Pyrogasm
This will work: return IsUnitAlly(GetEnumUnit(), GetOwningPlayer(GetTriggerUnit()))
10-01-2007, 06:57 AM#5
sinners_la_b
doesnt work :(
10-01-2007, 07:01 AM#6
Pyrogasm
Then another part of your code is the problem. Post all of it, please.
10-01-2007, 01:22 PM#7
Castlemaster
Collapse JASS:
IsUnitAlly(GetFilterUnit(), GetOwningPlayer(caster))
will get the unit as an ally
Collapse JASS:
IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(caster))
since both statements refer to the same unit, that would mean it will only return true if the unit is both an ally and enemy, which is quite impossible.

Just remove the IsUnitEnemy() statement.