From fe197cd2ffe688822b5d0f992cbd1c080cc82c8a Mon Sep 17 00:00:00 2001 From: Pao Date: Sat, 14 Jan 2023 22:31:23 +0100 Subject: [PATCH] Fixed some bugs --- media/lua/client/TOC_ContextMenus.lua | 29 +++++++++---------- media/lua/client/TOC_Update.lua | 4 +-- .../lua/client/TimedActions/AddedToOther.lua | 2 +- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/media/lua/client/TOC_ContextMenus.lua b/media/lua/client/TOC_ContextMenus.lua index a8bf0d2..58f81a3 100644 --- a/media/lua/client/TOC_ContextMenus.lua +++ b/media/lua/client/TOC_ContextMenus.lua @@ -51,6 +51,20 @@ function TryTheOnlyCureActionOnAnotherPlayer(_, part_name, action, surgeon, pati end + +function TryTocActionOnAnotherPlayer(_, part_name, action, surgeon, patient) + + + if action == "Cut" then + AskCanCutLimb(patient, part_name) + + elseif action == "Operate" then + AskCanOperateLimb(patient, part_name) + + end + +end + local function CheckIfCanBeOperated(modData) if modData.TOC.RightHand.is_cut and not modData.TOC.RightHand.is_operated or modData.TOC.RightForearm.is_cut and not modData.TOC.RightForearm.is_operated @@ -74,21 +88,6 @@ local function CloseAllMenus(player_index) end end - --- Declare context menus here so we can access them later -function ISWorldObjectContextMenu.OnFillTOCMenu(player, context, worldObjects, test) - - - -end - - -function ISWorldObjectContextMenu.OnFillOperateWithOven(player, context, worldObjects, test) - -end - - - ---------------------------------------------------------------------------------------------------------- TocContextMenus = {} diff --git a/media/lua/client/TOC_Update.lua b/media/lua/client/TOC_Update.lua index 7c9f295..a988e1d 100644 --- a/media/lua/client/TOC_Update.lua +++ b/media/lua/client/TOC_Update.lua @@ -35,8 +35,8 @@ function TheOnlyCure.CheckIfPlayerIsInfected(player, toc_data) for _, v in ipairs(GetLimbsBodyPartTypes()) do local toc_bodypart = FindTocDataPartNameFromBodyPartType(toc_data, v) if body_damage:getBodyPart(v):bitten() and toc_bodypart ~= nil then - if toc_bodypart.is_cut then - toc_data[toc_bodypart].is_infected = true + if toc_bodypart.is_cut == false then + toc_bodypart.is_infected = true player:transmitModData() end diff --git a/media/lua/client/TimedActions/AddedToOther.lua b/media/lua/client/TimedActions/AddedToOther.lua index b541ee2..69a7d89 100644 --- a/media/lua/client/TimedActions/AddedToOther.lua +++ b/media/lua/client/TimedActions/AddedToOther.lua @@ -28,7 +28,7 @@ function ISBaseTimedAction:adjustMaxTime(maxTime) for i,name in ipairs(protPartNames) do if modData.TOC[name].is_cut then if modData.TOC[name].is_prosthesis_equipped then - maxTime = maxTime * modData.TOC[name].EquipFact --todo this is dumb + maxTime = maxTime * modData.TOC[name].prothesis_factor --TODO this is dumb else maxTime = maxTime * 2; end