- Joined
- Mar 9, 2023
- Messages
- 75
Hi! One of my unit filters, which has been working for several versions, suddenly broke.
The following alternative to this filter works:
I have some other specific filters that are structured similar to the broken one, which no longer work either. Should I just suck it up and restructure them like the working alternative?
Edit: I'm really stupid.
This had actually been the original from the previous version, I guess my assumed original version was due to a fix I tried. Weird.
This works now. In the "broken" filter I forgot to also check for AI player 10, which is the AI enemy that I also assigned my test units to. So there was never any issue reported as P10 rarely handles units. So the filter worked in normal play and not my testing, leading me to believe that the entire filter had broken down. I'm a bit sleepy when I have time to work in WC3...
JASS:
function AttackBoss takes nothing returns boolean
local unit u = GetFilterUnit()
local boolean result = GetUnitState(u,UNIT_STATE_LIFE) > 0.023 and (GetOwningPlayer(u)==Player(11) or GetOwningPlayer(u)==Player(12)) and GetUnitAbilityLevel(u,'Aloc')==0 and GetUnitAbilityLevel(u,'Avul')==0 and UnitHasBuffBJ(u,'B00T')==false
set u = null
return result
endfunction
The following alternative to this filter works:
JASS:
function AttackBoss takes nothing returns boolean
return GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE) > 0.023 and (GetOwningPlayer(GetFilterUnit())==Player(10) or GetOwningPlayer(GetFilterUnit())==Player(11)) and GetUnitAbilityLevel(GetFilterUnit(),'Aloc')==0 and GetUnitAbilityLevel(GetFilterUnit(),'Avul')==0 and UnitHasBuffBJ(GetFilterUnit(),'B00T')==false
endfunction
I have some other specific filters that are structured similar to the broken one, which no longer work either. Should I just suck it up and restructure them like the working alternative?
Edit: I'm really stupid.
JASS:
function AttackBoss takes nothing returns boolean
local unit u = GetFilterUnit()
local boolean result = GetUnitState(u,UNIT_STATE_LIFE) > 0.023 and (GetOwningPlayer(u)==Player(10) or GetOwningPlayer(u)==Player(11)) and GetUnitAbilityLevel(u,'Aloc')==0 and GetUnitAbilityLevel(u,'Avul')==0 and UnitHasBuffBJ(u,'B00T')==false
set u = null
return result
endfunction
This had actually been the original from the previous version, I guess my assumed original version was due to a fix I tried. Weird.
JASS:
local boolean result = GetUnitState(u,UNIT_STATE_LIFE) > 0.023 and GetOwningPlayer(u)==Player(11) and GetUnitAbilityLevel(u,'Aloc')==0 and GetUnitAbilityLevel(u,'Avul')==0 and UnitHasBuffBJ(u,'B00T')==false
This works now. In the "broken" filter I forgot to also check for AI player 10, which is the AI enemy that I also assigned my test units to. So there was never any issue reported as P10 rarely handles units. So the filter worked in normal play and not my testing, leading me to believe that the entire filter had broken down. I'm a bit sleepy when I have time to work in WC3...
Last edited: