more cleaning

This commit is contained in:
Pao
2023-01-23 01:15:11 +01:00
parent b7effc0d62
commit 5770b8a488
9 changed files with 10 additions and 45 deletions

View File

@@ -102,7 +102,4 @@ function TocMapOldDataToNew(mod_data)
end
getPlayer():transmitModData()
end

View File

@@ -115,10 +115,7 @@ end
TocContextMenus.FillCutAndOperateMenus = function(local_player, clicked_player, world_objects, cut_menu, operate_menu)
local local_part_data = local_player:getModData().TOC.Limbs
TocContextMenus.FillCutAndOperateMenus = function(local_player, clicked_player, world_objects, cut_menu, operate_menu)
for _, v in ipairs(GetBodyParts()) do
if local_player == clicked_player then -- Local player
if CheckIfCanBeCut(v) and TocGetSawInInventory(local_player) ~= nil then
@@ -149,8 +146,6 @@ TocContextMenus.FillCutAndOperateMenus = function(local_player, clicked_player,
end
TocContextMenus.CreateCheatMenu = function(context, root_menu, local_player, clicked_player)
if local_player:getAccessLevel() == "Admin" then

View File

@@ -17,7 +17,4 @@ function TocResetEverything()
cloth = nil -- reset it
end
player:transmitModData()
end

View File

@@ -1,5 +1,4 @@
-- CutLimb
-- TODO if TheONlyCure. triggers an errors
function TocCheckIfStillInfected(limbs_data)
if limbs_data == nil then
return

View File

@@ -286,11 +286,10 @@ function TheOnlyCure.CutLimb(part_name, surgeon_factor, bandage_table, painkille
for _, depended_v in pairs(limbs_data[part_name].depends_on) do
limbs_data[depended_v].is_cut = true
limbs_data[depended_v].is_amputation_shown = false
limbs_data[depended_v].cicatrization_time = limbs_data[part_name].cicatrization_base_time - surgeon_factor * 50
limbs_data[depended_v].cicatrization_time = limbs_data[part_name].cicatrization_base_time -
surgeon_factor * 50
end
-- Check for older amputation models and deletes them from player's inventory
local side = string.match(part_name, '(%w+)_')
TocDeleteOtherAmputatedLimbs(side)
@@ -327,7 +326,8 @@ function TheOnlyCure.OperateLimb(part_name, surgeon_factor, use_oven)
if use_oven then limbs_data[part_name].is_cauterized = true end
for _, depended_v in pairs(limbs_data[part_name].depends_on) do
limbs_data[depended_v].is_operated = true
limbs_data[depended_v].cicatrization_time = limbs_data[depended_v].cicatrization_time - (surgeon_factor * 200)
limbs_data[depended_v].cicatrization_time = limbs_data[depended_v].cicatrization_time -
(surgeon_factor * 200)
if use_oven then limbs_data[depended_v].is_cauterized = true end -- TODO does this make sense?
end
@@ -335,7 +335,6 @@ function TheOnlyCure.OperateLimb(part_name, surgeon_factor, use_oven)
end
SetBodyPartsStatusAfterOperation(player, limbs_data, part_name, use_oven)
player:transmitModData()
end
function TheOnlyCure.EquipProsthesis(part_name, prosthesis_base_name)
@@ -379,11 +378,8 @@ function TheOnlyCure.UnequipProsthesis(part_name, equipped_prosthesis)
local prosthesis_name = string.match(equipped_prosthesis_full_type, prost_v)
if prosthesis_name then
player:getInventory():AddItem("TOC." .. prosthesis_name)
player:setWornItem(equipped_prosthesis:getBodyLocation(), nil)
player:getInventory():Remove(equipped_prosthesis)
player:transmitModData()
end
end
@@ -408,20 +404,17 @@ function TryTocAction(_, part_name, action, surgeon, patient)
TocUnequipProsthesisLocal(_, surgeon, part_name)
end
else
local ui = GetConfirmUIMP()
if not ui then
CreateTocConfirmUIMP()
ui = GetConfirmUIMP()
end
if patient == nil then
patient = surgeon
end
if action == "Cut" then
AskCanCutLimb(patient, part_name)
elseif action == "Operate" then
@@ -431,11 +424,11 @@ function TryTocAction(_, part_name, action, surgeon, patient)
elseif action == "Unequip" then
AskCanUnequipProsthesis(patient, part_name)
end
ui.actionAct = action
ui.partNameAct = part_name
ui.patient = patient
SendCommandToConfirmUIMP("Wait server")
end

View File

@@ -58,7 +58,6 @@ function ISInstallProsthesis:perform()
TheOnlyCure.EquipProsthesis(self.part_name, prosthesis_base_name)
end
self.character:transmitModData()
-- needed to remove from queue / start next.
ISBaseTimedAction.perform(self)

View File

@@ -57,7 +57,6 @@ function ISUninstallProsthesis:perform()
else
TheOnlyCure.UnequipProsthesis(self.part_name, self.item)
end
self.character:transmitModData()
ISBaseTimedAction.perform(self)