WeakAuras

WeakAuras

200M Downloads

Fonction Bug on random character

aurosh76 opened this issue ยท 3 comments

commented

Is there an existing issue for this?

  • I have searched the existing open and closed issues.

Description

Hi,
I have a function that serves as a trigger that works for certain characters and not others:

function()
local e = aura_env

local last = e.result or 0

local counter = 0
for i = 1, 40 do
    local unit = "nameplate"..i
    if UnitExists(unit) then
        if WeakAuras.GetRange(unit) < 25 and not UnitIsFriend("player", unit) then
            counter = counter + 1 
        end
    end
end
if counter ~= last then
    WeakAuras.ScanEvents("WA_ENEMIES_IN_RANGE", counter)
end
e.result = counter
if e.result == 0 or e.result == 1 or e.result == 2 then
    return false
end
return true

end

Bug sack say the error come to "attempt to compare nil with number"

This function works for 3 of my characters but not for the others and I don't have the impression of having a difference in interface

WeakAuras Version

5.13.2

World of Warcraft Flavor

Retail (Default)

World of Warcraft Region

EU

Tested with only WeakAuras

I got this issue with only WeakAuras enabled

Lua Error

432x Lua error in aura 'Impact foudrouyant 4': Trigger 1
WeakAuras Version: 5.13.1
[string "return function()"]:10: attempt to compare nil with number
[string "return function()"]:10: in function <[string "return function()"]:1>
[string "=[C]"]: in function `xpcall'
[string "@WeakAuras/GenericTrigger.lua"]:718: in function <WeakAuras/GenericTrigger.lua:627>
[string "@WeakAuras/GenericTrigger.lua"]:880: in function `ScanEventsInternal'
[string "@WeakAuras/GenericTrigger.lua"]:825: in function `ScanEvents'
[string "@WeakAuras/GenericTrigger.lua"]:1824: in function <WeakAuras/GenericTrigger.lua:1822>

Locals:
e = <table> {
 config = <table> {
 }
 region = Frame {
 }
 id = "Impact foudrouyant 4"
 result = 1
}
last = 1
counter = 1
(for index) = 2
(for limit) = 40
(for step) = 1
i = 2
unit = "nameplate2"
(*temporary) = nil
(*temporary) = "nameplate2"
(*temporary) = nil
(*temporary) = "attempt to compare nil with number"


### Reproduction Steps

This function works for 3 of my characters but not for the others and I don't have the impression of having a difference in interface

### Last Good Version

_No response_

### Screenshots

_No response_

### Export String

_No response_

### Bisector Report

```Text
!WA:2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tcXChAkt0wxuAao97dDqr1hE3S5hHldWXSos8yG(J)fX7RHt0nT)Gtay03u0uZ6cfRk1FY(lSM4w2fQicszSPLWTuPsZEEUwiUTLvTs5dASV4TTkjP4yogiHhYO6OkLXLxK7l2ja1Q8FpkNr(Fwqq)s7(FdsqWAFA2CdSzc0avwP6(v9YMxIPGbZalWCE)zXN(fjbsRDlC25fUFzkHI1fIBJgIfUsK)ScpnLYXUxS8RRGqpfN9zHn1r4PEesBE6ilQEjs6HsI4SdlegnjqSS(7FqJD3PQxrX7kx)KnN4()bolxW34tQ4dEDrJqcHmtJ4Sx6U6SxapTOC(SPkNhJqrI2wbraRtKUxqEvnQsCcH(Zdn879iYUyNE05H48VcJtQ52KWheOy8oXWRUPFxCiKD3xDZwbAsmsbC3mItflMSwZHY2RjSVDl5lW(C8YNzoR4wPWw(2DqOb13U8ELRIVWa7lK0nGOB1xCSi3SOnX8WyCXTqaLPMEbGc09iNez7EsLGPoBgm93C3Y7v7I8CEljsoBQ5b1303ZR6fhbGOSX7ixlonenKXZRIyD7UdrXqiNmRvqxMuMiJUUlz8Obs74JD08TKe7nrQnYw1j7V7ubNj1o9XslNAdNk76v9ZpBY03APm6WJA49jFlvUvWY1qQLlJ0AeKxa7MksjXg7yOyAtcHNxMsrN88j8UpVwspqAf3dOmYZZ1A(DdXDg)blMHKpNPmxPsJQ8IKKULQyMaBnqNeECoV19k9FswKrf3zQpGi18feUpzyBtCH8v4uZSIfWsX4VpatoSecT87zMz)F(Kyrez2aK5QnRJJKXnMhIKNu02nc9lMN7lSvlNbgkowU8zJd3O(t4mYMBbvW6RS6JxzTfo(vp73d
commented

This is a bug tracker not a help forum.

commented

a function that bugs with certain characters and not others is not a bug?

commented

It's a bug in your own code not in WeakAuras.