WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Help solve an Error (https://www.wowinterface.com/forums/showthread.php?t=57683)

tinyu 11-17-19 12:49 AM

Help solve an Error
 
1 Attachment(s)
Back in the day I used an addon called _Corpse that would tell me if a corpse I find when out questing was from the opposing faction or not and if they were online or not.

I have been making slow progress with getting it to work with Classic but i have run into an error I can't figure out (very limited knowledge on my part).

The error is this.

Code:

Date: 2019-11-17 01:55:20
ID: -1
Error occured in: Global
Count: 3
Message: ..\AddOns\_Corpse\_Corpse.lua line 115:
  Usage: UnitDebuff("unit", [index][, "filter"])
Debug:
  [C]: ?
  [C]: UnitDebuff()
  _Corpse\_Corpse.lua:115: UnitHasCorpse()
  _Corpse\_Corpse.lua:173:
      _Corpse\_Corpse.lua:159
  [C]: ?
  [C]: ?

Here is the addon is it stands atm.

Thank you for your help.

Xrystal 11-17-19 01:23 AM

A quick look and there is no validation that UnitID exists or is valid prior to using it ..

UnitDebuff(unit,index) is required .. you have UnitDebuff(UnitID,GHOST)

I assume GHOST is a valid index number, if not you might want to check that as well.
Which means UnitID must be nil or invalid and thus causing an error when attempting to use it.

It might not be the reason but if you haven't checked it out it might be worth doing.

tinyu 11-17-19 07:37 AM

Quote:

Originally Posted by Xrystal (Post 334582)
A quick look and there is no validation that UnitID exists or is valid prior to using it ..

UnitDebuff(unit,index) is required .. you have UnitDebuff(UnitID,GHOST)

I assume GHOST is a valid index number, if not you might want to check that as well.
Which means UnitID must be nil or invalid and thus causing an error when attempting to use it.

It might not be the reason but if you haven't checked it out it might be worth doing.

Thank you very much, now I just need to find some dead people to test it on lol.


All times are GMT -6. The time now is 07:02 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI