Fixes
This commit is contained in:
@@ -180,22 +180,26 @@ function ISEquipWeaponAction:isValid()
|
||||
|
||||
|
||||
-- Both hands are cut off
|
||||
if not(isPrimaryHandValid and isSecondaryHandValid) then
|
||||
return false
|
||||
if not isPrimaryHandValid and not isSecondaryHandValid then
|
||||
TOC_DEBUG.print("Both hands invalid")
|
||||
isValid = false
|
||||
end
|
||||
|
||||
-- Equip primary and no right hand (with no prost)
|
||||
if self.jobType:contains(equipPrimaryText) and not isPrimaryHandValid then
|
||||
TOC_DEBUG.print("Equip primary, no right hand, not valid")
|
||||
return false
|
||||
isValid = false
|
||||
end
|
||||
|
||||
-- Equip secondary and no left hand (with no prost)
|
||||
if self.jobType:contains(equipSecondaryText) and not isSecondaryHandValid then
|
||||
TOC_DEBUG.print("Equip secondary, no left hand, not valid")
|
||||
return false
|
||||
isValid = false
|
||||
end
|
||||
end
|
||||
|
||||
TOC_DEBUG.print("isValid to return -> " .. tostring(isValid))
|
||||
--print("_________________________________")
|
||||
return isValid
|
||||
end
|
||||
|
||||
@@ -270,6 +274,13 @@ function ISEquipWeaponAction:performWithAmputation(modDataHandler)
|
||||
|
||||
local isFirstValid = not modDataHandler:getIsCut(hand) or modDataHandler:getIsProstEquipped(prostGroup)
|
||||
local isSecondValid = not modDataHandler:getIsCut(otherHand) or modDataHandler:getIsProstEquipped(otherProstGroup)
|
||||
TOC_DEBUG.print("First Hand: " .. tostring(hand))
|
||||
TOC_DEBUG.print("Prost Group: " .. tostring(prostGroup))
|
||||
TOC_DEBUG.print("Other Hand: " .. tostring(otherHand))
|
||||
TOC_DEBUG.print("Other Prost Group: " .. tostring(otherProstGroup))
|
||||
|
||||
TOC_DEBUG.print("isPrimaryHandValid: " .. tostring(isFirstValid))
|
||||
TOC_DEBUG.print("isSecondaryHandValid: " .. tostring(isSecondValid))
|
||||
|
||||
|
||||
if isFirstValid then
|
||||
|
||||
@@ -78,15 +78,19 @@ local function AddInvAmputationOptions(player, context, sawItem, stitchesItem, b
|
||||
|
||||
-- Set the correct text option
|
||||
if stitchesItem and bandageItem then
|
||||
TOC_DEBUG.print("stitches and bandage")
|
||||
text = textAmpStitchBandage
|
||||
elseif stitchesItem and not bandageItem then
|
||||
elseif not bandageItem and stitchesItem then
|
||||
TOC_DEBUG.print("only stitches")
|
||||
text = textAmpStitch
|
||||
elseif bandageItem and not stitchesItem then
|
||||
elseif not stitchesItem and bandageItem then
|
||||
TOC_DEBUG.print("only bandages")
|
||||
text = textAmpBandage
|
||||
else
|
||||
text = textAmp
|
||||
end
|
||||
|
||||
TOC_DEBUG.print("Current text " .. tostring(text))
|
||||
local option = context:addOption(text, nil)
|
||||
local subMenu = context:getNew(context)
|
||||
context:addSubMenu(option, subMenu)
|
||||
@@ -125,6 +129,11 @@ local function AddInventoryAmputationMenu(playerNum, context, items)
|
||||
|
||||
local stitchesItem = GetStitchesItem(player)
|
||||
local bandageItem = GetBandageItem(player)
|
||||
|
||||
TOC_DEBUG.print("Stitches item: " .. tostring(stitchesItem))
|
||||
TOC_DEBUG.print("Bandage item: " .. tostring(bandageItem))
|
||||
|
||||
|
||||
--if bandageItem then
|
||||
AddInvAmputationOptions(player, context, sawItem, stitchesItem, bandageItem)
|
||||
--end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ContextMenu_EN = {
|
||||
ContextMenu_Amputate = "Amputate",
|
||||
ContextMenu_Amputate_Bandage = "Amputate and bandage",
|
||||
ContextMenu_Amputate_Stitch_Bandage = "Amputate and stitches",
|
||||
ContextMenu_Amputate_Stitch = "Amputate and stitches",
|
||||
ContextMenu_Amputate_Stitch_Bandage = "Amputate, stitches and bandage",
|
||||
|
||||
ContextMenu_Cauterize = "Cauterize",
|
||||
|
||||
Reference in New Issue
Block a user