diff --git a/media/lua/client/TOC_Checks.lua b/media/lua/client/TOC_Checks.lua index 95261b4..8ca3bba 100644 --- a/media/lua/client/TOC_Checks.lua +++ b/media/lua/client/TOC_Checks.lua @@ -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 diff --git a/media/lua/client/TOC_Client.lua b/media/lua/client/TOC_Client.lua index 3141a59..089c14a 100644 --- a/media/lua/client/TOC_Client.lua +++ b/media/lua/client/TOC_Client.lua @@ -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 diff --git a/media/lua/client/TOC_OverridenFunctions.lua b/media/lua/client/TOC_OverridenFunctions.lua index 99ae724..0236cd9 100644 --- a/media/lua/client/TOC_OverridenFunctions.lua +++ b/media/lua/client/TOC_OverridenFunctions.lua @@ -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 diff --git a/media/models_X/Prost_Left_LowerArm_Hook_Male.fbx b/media/models_X/Prost_Left_LowerArm_Hook_Male.fbx index 839b035..93304a2 100644 Binary files a/media/models_X/Prost_Left_LowerArm_Hook_Male.fbx and b/media/models_X/Prost_Left_LowerArm_Hook_Male.fbx differ diff --git a/media/models_X/Prost_Right_LowerArm_Hook_Male.fbx b/media/models_X/Prost_Right_LowerArm_Hook_Male.fbx index 4dc30e6..3b37b3b 100644 Binary files a/media/models_X/Prost_Right_LowerArm_Hook_Male.fbx and b/media/models_X/Prost_Right_LowerArm_Hook_Male.fbx differ diff --git a/media/textures/Clothes/wood.png b/media/textures/Clothes/wood.png index a028265..1130dba 100644 Binary files a/media/textures/Clothes/wood.png and b/media/textures/Clothes/wood.png differ diff --git a/models_stuff/working_left_lowerarm_male.blend b/models_stuff/working_left_lowerarm_male.blend new file mode 100644 index 0000000..038f56d Binary files /dev/null and b/models_stuff/working_left_lowerarm_male.blend differ diff --git a/models_stuff/working_right_lowerarm_male.blend b/models_stuff/working_right_lowerarm_male.blend new file mode 100644 index 0000000..5a6aa7b Binary files /dev/null and b/models_stuff/working_right_lowerarm_male.blend differ