- Fixed some MP checks
- New prost for lower arm males
This commit is contained in:
@@ -30,22 +30,17 @@ function CheckIfCanBeOperated(part_name, limbs_data)
|
||||
|
||||
end
|
||||
|
||||
function CheckIfProsthesisCanBeEquipped(part_name, item)
|
||||
local part_data = getPlayer():getModData().TOC.Limbs
|
||||
|
||||
|
||||
if item ~= nil then
|
||||
if part_data[part_name].is_operated then
|
||||
return true
|
||||
end
|
||||
else
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function CheckIfProsthesisCanBeEquipped(part_name)
|
||||
local limbs_data = getPlayer():getModData().TOC.Limbs
|
||||
return limbs_data[part_name].is_cauterized or limbs_data[part_name].is_cicatrized
|
||||
-- check if prosthesis is in the surgeon inventory... we need to get it before
|
||||
end
|
||||
|
||||
|
||||
function CheckIfProsthesisCanBeUnequipped(part_name)
|
||||
|
||||
-- TODO we should get item here to be sure that we can do this action instead of relying on some later checks
|
||||
return true
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ function AskCanEquipProsthesis(player, part_name)
|
||||
arg["From"] = getPlayer():getOnlineID()
|
||||
arg["To"] = player:getOnlineID()
|
||||
arg["command"] = "CanEquipProsthesis"
|
||||
arg["toSend"] = part_name
|
||||
arg["toSend"] = part_name -- TODO to be more precise there should be prosthesis item here too to check
|
||||
|
||||
sendClientCommand("TOC", "SendServer", arg)
|
||||
end
|
||||
@@ -152,10 +152,12 @@ end
|
||||
|
||||
Commands["CanEquipProsthesis"] = function(arg)
|
||||
local part_name = arg["toSend"]
|
||||
--local item = arg["toSend"][2] -- TODO Add item prosth here
|
||||
|
||||
arg["To"] = arg["From"]
|
||||
arg["From"] = getPlayer():getOnlineID()
|
||||
arg["command"] = "ResponseCanAct"
|
||||
arg["toSend"] = { part_name, "Equip", true } -- FIXME true just for test
|
||||
arg["toSend"] = {part_name, "Equip", CheckIfProsthesisCanBeEquipped(part_name) }
|
||||
sendClientCommand("TOC", "SendServer", arg)
|
||||
|
||||
end
|
||||
@@ -165,7 +167,7 @@ Commands["CanUnequipProsthesis"] = function(arg)
|
||||
arg["To"] = arg["From"]
|
||||
arg["From"] = getPlayer():getOnlineID()
|
||||
arg["command"] = "ResponseCanAct"
|
||||
arg["toSend"] = { part_name, "Unequip", true } -- FIXME true just for test
|
||||
arg["toSend"] = { part_name, "Unequip", CheckIfProsthesisCanBeUnequipped(part_name)}
|
||||
sendClientCommand("TOC", "SendServer", arg)
|
||||
|
||||
end
|
||||
|
||||
@@ -95,7 +95,6 @@ local og_ISInventoryPaneGetActualItems = ISInventoryPane.getActualItems
|
||||
function ISInventoryPane.getActualItems(items)
|
||||
|
||||
-- TODO add an exception for installed prosthesis, make them unequippable automatically from here and get the correct obj
|
||||
|
||||
local ret = og_ISInventoryPaneGetActualItems(items)
|
||||
|
||||
-- This is gonna be slower than just overriding the function but hey it's more compatible
|
||||
|
||||
Reference in New Issue
Block a user