TOC_Update was broken since... I dunno
This commit is contained in:
@@ -14,17 +14,17 @@ function TryTocAction(_, part_name, action, surgeon, patient)
|
||||
if not isServer() and not isClient() then
|
||||
|
||||
if action == "Cut" then
|
||||
TocCutLocal(_, patient, patient, part_name)
|
||||
TocCutLocal(_, surgeon, surgeon, part_name)
|
||||
elseif action == "Operate" then
|
||||
TocOperateLocal(_, patient, patient, part_name, false)
|
||||
TocOperateLocal(_, surgeon, surgeon, part_name, false)
|
||||
elseif action == "Equip" then
|
||||
-- TODO finish this
|
||||
local item
|
||||
TocEquipProsthesisLocal(_, patient, surgeon, part_name)
|
||||
TocEquipProsthesisLocal(_, surgeon, surgeon, part_name)
|
||||
elseif action == "Unequip" then
|
||||
-- TODO finish this
|
||||
local item
|
||||
TocUnequipProsthesisLocal(_, patient, part_name)
|
||||
TocUnequipProsthesisLocal(_, surgeon, part_name)
|
||||
end
|
||||
else
|
||||
|
||||
@@ -39,6 +39,10 @@ function TryTocAction(_, part_name, action, surgeon, patient)
|
||||
elseif action == "Operate" then
|
||||
AskCanOperateLimb(patient, part_name)
|
||||
elseif action == "Equip" then
|
||||
|
||||
|
||||
|
||||
|
||||
--AskCanEquipProsthesis(patient, part_name, item)
|
||||
|
||||
elseif action == "Unequip" then
|
||||
@@ -68,19 +72,19 @@ 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
|
||||
or modData.TOC.RightArm.is_cut and not modData.TOC.RightArm.is_operated
|
||||
or modData.TOC.LeftHand.is_cut and not modData.TOC.LeftHand.is_operated
|
||||
or modData.TOC.LeftForearm.is_cut and not modData.TOC.LeftForearm.is_operated
|
||||
or modData.TOC.LeftArm.is_cut and not modData.TOC.LeftArm.is_operated then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
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
|
||||
-- or modData.TOC.RightArm.is_cut and not modData.TOC.RightArm.is_operated
|
||||
-- or modData.TOC.LeftHand.is_cut and not modData.TOC.LeftHand.is_operated
|
||||
-- or modData.TOC.LeftForearm.is_cut and not modData.TOC.LeftForearm.is_operated
|
||||
-- or modData.TOC.LeftArm.is_cut and not modData.TOC.LeftArm.is_operated then
|
||||
-- return true
|
||||
-- else
|
||||
-- return false
|
||||
-- end
|
||||
|
||||
end
|
||||
-- end
|
||||
|
||||
local function CloseAllMenus(player_index)
|
||||
local contextMenu = getPlayerContextMenu(player_index)
|
||||
|
||||
@@ -167,7 +167,9 @@ local function OnClickTocDescUI(button, args)
|
||||
local patient = args.patient
|
||||
local surgeon = args.surgeon
|
||||
|
||||
|
||||
if patient == nil then
|
||||
patient = surgeon
|
||||
end
|
||||
-- Validate action
|
||||
if args.option == "Cut" then
|
||||
TryTocAction(_, desc_ui.part_name, "Cut", surgeon, patient)
|
||||
|
||||
@@ -215,7 +215,7 @@ function TheOnlyCure.UpdateEveryTenMinutes()
|
||||
|
||||
-- Updates the cicatrization timesssss
|
||||
for _, part_name in pairs(GetBodyParts()) do
|
||||
if toc_data[part_name].is_cut and toc_data[part_name].is_cicatrized then
|
||||
if toc_data[part_name].is_cut and not toc_data[part_name].is_cicatrized then
|
||||
toc_data[part_name].cicatrization_time = toc_data[part_name].cicatrization_time - 1 -- TODO Make it more "dynamic"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user