From 148827253189d215807e7af87f41430dc3931a50 Mon Sep 17 00:00:00 2001 From: Vapok Date: Mon, 18 May 2020 01:51:25 -0400 Subject: [PATCH] Fixing a null error issue. --- Modules/Award.lua | 1 - init.lua | 15 +++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Modules/Award.lua b/Modules/Award.lua index a12605ee..cd5433f5 100644 --- a/Modules/Award.lua +++ b/Modules/Award.lua @@ -47,7 +47,6 @@ local function AwardItem(player, cost, boss, zone, loot, reassign) MonDKP:StatusVerify_Update() if core.IsOfficer then - print("Is Officer"); if MonDKP_DB.modes.costvalue == "Percent" then local search = MonDKP:Table_Search(MonDKP_DKPTable, winner); diff --git a/init.lua b/init.lua index 18e0fee6..e04df178 100644 --- a/init.lua +++ b/init.lua @@ -72,14 +72,21 @@ MonDKP.Commands = { if not name or not strfind(name, ":::::") then MonDKP:Print(L["AWARDWARNING"]) return - end + end local item = strjoin(" ", ...) if not item then return end item = name.." "..item; - local itemName,itemLink,_,_,_,_,_,_,_,_ = GetItemInfo(item) + local itemName,_,_,_,_,_,_,_,_,_ = GetItemInfo(item) + local cost = 0; local search = MonDKP:Table_Search(MonDKP_MinBids, itemName) - local cost = MonDKP_MinBids[search[1][1]].minbid or MonDKP:GetMinBid(itemLink); - MonDKP:AwardConfirm(nil, cost, MonDKP_DB.bossargs.LastKilledBoss, MonDKP_DB.bossargs.CurrentRaidZone, item) + + if not search then + cost = MonDKP:GetMinBid(item) + else + cost = MonDKP_MinBids[search[1][1]].minbid; + end + + MonDKP:AwardConfirm(nil, cost, MonDKP_DB.bossargs.LastKilledBoss, MonDKP_DB.bossargs.CurrentRaidZone, item) else MonDKP:Print(L["NOPERMISSION"]) end