[JASS] *SOLVED* Using value from UNIT_WEAPON_IF_ATTACK_TARGETS_ALLOWED in a jass filter?

Status
Not open for further replies.
I wrote this but I'm not sure what's wrong with it

JASS:
function IsObjectEditorTarget takes unit u, integer flags returns boolean
    local integer filter = 0xFFF07FE//Strip out the flags that are different depending on context e.g. enemy
    local integer inputflags = BlzBitAnd(flags,filter)
    local integer unitflags = BlzBitAnd(BlzGetUnitIntegerField(u,UNIT_IF_TARGETED_AS),filter)
    return BlzBitAnd(unitflags,inputflags) > 0
endfunction
 
Try this filter value:

JASS:
    local integer filter = 0xFFFE07FE
    // Bit representation: 1111 1111 1111 1110 0000 0111 1111 1110
That works thanks

Here is the function if anyone else needs it:

JASS:
function IsObjectEditorTarget takes unit u, integer flags returns boolean
    local integer filter = 0xFFFE07FE//Strip out the flags that are different depending on context e.g. enemy
    local integer inputflags = BlzBitAnd(flags,filter)
    local integer unitflags = BlzBitAnd(BlzGetUnitIntegerField(u,UNIT_IF_TARGETED_AS),filter)
    return BlzBitAnd(unitflags,inputflags) > 0
endfunction
 
Status
Not open for further replies.
Back
Top