Fixes after first test

This commit is contained in:
Pao
2023-02-26 23:12:57 +01:00
parent 8b51a13c71
commit 8de5e17cd0
6 changed files with 15 additions and 11 deletions

View File

@@ -3,6 +3,10 @@
------------------------------------------
----------- CUT LIMB FUNCTIONS -----------
-- Seems to be the first file loaded, so let's add this
if JCIO == nil then
JCIO = {}
end

View File

@@ -592,7 +592,7 @@ JCIO.RefreshClientMenu = function(_)
else
local limbs_data = JCIO_UI.onlineTempTable.patient:getModData().TOC.Limbs
local limbs_data = JCIO_UI.onlineTempTable.patient:getModData().JCIO.limbs
JCIO_UI.SetupMainUI(JCIO_UI.onlineTempTable.patient, JCIO_UI.onlineTempTable.patient, limbs_data)
end

View File

@@ -25,7 +25,7 @@ JCIO_Common.GeneratePartNames = function()
end
JCIO_Common.GetPartNames = function()
if JCIO_Common.partNames.size() == nil then
if JCIO_Common.partNames[1] == nil then
JCIO_Common.GeneratePartNames()
end

View File

@@ -30,13 +30,13 @@ local function PartNameToBodyLocationAmputation(name)
if name == "Right_Foot" then return "JCIO_LegRight" end
end
function TocFindItemInProstBodyLocation(part_name, patient)
function TocFindItemInProstBodyLocation(partName, patient)
-- Can't be used for online purposes, since we can't get the online inventory of another player
local worn_items = patient:getWornItems()
for i = 1, worn_items:size() - 1 do -- Maybe wornItems:size()-1
local item = worn_items:get(i):getItem()
if item:getBodyLocation() == PartNameToBodyLocationProsthesis(part_name) then
if item:getBodyLocation() == PartNameToBodyLocationProsthesis(partName) then
return item
end
end
@@ -44,19 +44,19 @@ function TocFindItemInProstBodyLocation(part_name, patient)
end
-- Debug cheat and update every minute for cicatrization
function TocFindAmputationOrProsthesisName(part_name, player, choice)
function TocFindAmputationOrProsthesisName(partName, player, choice)
local worn_items = player:getWornItems()
for i = 1, worn_items:size() - 1 do
local item = worn_items:get(i):getItem()
if choice == "Amputation" then
if item:getBodyLocation() == PartNameToBodyLocationAmputation(part_name) then
if item:getBodyLocation() == PartNameToBodyLocationAmputation(partName) then
return item:getFullType()
end
elseif choice == "Prosthesis" then
if item:getBodyLocation() == PartNameToBodyLocationProsthesis(part_name) then
if item:getBodyLocation() == PartNameToBodyLocationProsthesis(partName) then
return item:getFullType()
end

View File

@@ -123,9 +123,9 @@ function ISEquipWeaponAction:perform()
--TODO Block it before even performing
-- TODO in the inventory menu there is something broken, even though this works
og_ISEquipWeaponActionPerform(self)
local limbs_data = self.character:getModData().TOC.Limbs
local can_be_held = {}
JCIO_Common.GetCanBeHeldTable(can_be_held, limbs_data)
local limbs_data = self.character:getModData().JCIO.limbs
local can_be_held = JCIO_Common.GetCanBeHeldTable(limbs_data)
if not self.item:isRequiresEquippedBothHands() then
if can_be_held["Right"] and not can_be_held["Left"] then

View File

@@ -4,7 +4,7 @@
------------- UPDATE EVENTS --------------
require "TOC_Init"
require "JCIO_Init"
local function CheckIfPlayerIsInfected(player, limbsData)