• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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

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
 
Top