- Joined
- Jun 7, 2008
- Messages
- 440
g'day fellow hivers. I got a question; is there a way to condense this and make it... well... neater?
I only ask because it always pop up when converting triggers with multiple conditions.
JASS:
function Trig_Multiple_Check takes nothing returns boolean
if ( not ( IsUnitType(GetEnumUnit(), UNIT_TYPE_STRUCTURE) == false ) ) then
return false
endif
if ( not ( IsUnitType(GetEnumUnit(), UNIT_TYPE_MECHANICAL) == false ) ) then
return false
endif
if ( not ( IsUnitType(GetEnumUnit(), UNIT_TYPE_MAGIC_IMMUNE) == false ) ) then
return false
endif
if ( not ( IsUnitEnemy(GetEnumUnit(), GetOwningPlayer(GetTriggerUnit())) == true ) ) then
return false
endif
if ( not ( IsUnitDeadBJ(GetEnumUnit()) == false ) ) then
return false
endif
if ( not ( IsUnitInGroup(GetEnumUnit(), udg_Temp_Group) == false ) ) then
return false
endif
if ( not ( R2I(GetUnitStateSwap(UNIT_STATE_MAX_MANA, GetEnumUnit())) > 0 ) ) then
return false
endif
if ( not ( IsUnitType(GetEnumUnit(), UNIT_TYPE_STRUCTURE) == false ) ) then
return false
endif
if ( not ( udg_Temp_Real < GetUnitStateSwap(UNIT_STATE_MANA, GetEnumUnit()) ) ) then
return false
endif
return true
endfunction
I only ask because it always pop up when converting triggers with multiple conditions.