From 591f2c352775c19d6bf0b09774d648c439eaf486 Mon Sep 17 00:00:00 2001 From: Taracque Date: Fri, 13 Sep 2013 12:38:56 +0200 Subject: [PATCH] Fixed LUA error, where no weapon is equipped. --- DKCrutch.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/DKCrutch.lua b/DKCrutch.lua index 65b0502..05092f4 100755 --- a/DKCrutch.lua +++ b/DKCrutch.lua @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- DKCrutch 0.9.4 +-- DKCrutch 0.9.5 -- -- Death Knight rune tracker and ability advisor ------------------------------------------------------------------------------- @@ -8,7 +8,7 @@ DKCrutch = {Locals = {}} local L = DKCrutch.Locals -DKCrutch.versionNumber = '0.9.4' +DKCrutch.versionNumber = '0.9.5' DKCrutch.talent = "" DKCrutch.talentUnsure = true DKCrutch.DebugMode = false @@ -121,12 +121,14 @@ function DKCrutch.events.PLAYER_ALIVE() end function DKCrutch.events.PLAYER_EQUIPMENT_CHANGED() - local _, itemType; + local _, itemType, itemSlot; DKCrutch.hasT15_4pcs = DKCrutch:HasSetBonus( 138347, 4 ); - - _, _, _, _, _, _, _, _, itemType = GetItemInfo( GetInventoryItemID("player", GetInventorySlotInfo("MainHandSlot"))); - DKCrutch.dualWield = (itemType == "INVTYPE_WEAPON"); + _, itemSlot = GetInventorySlotInfo("MainHandSlot"); + if (itemSlot) then + _, _, _, _, _, _, _, _, itemType = GetItemInfo( GetInventoryItemID("player", itemSlot)); + DKCrutch.dualWield = (itemType == "INVTYPE_WEAPON"); + end end function DKCrutch.events.PLAYER_ENTERING_WORLD() -- 1.7.9.5