Fixed Interact Key bug

This commit is contained in:
ZioPao
2024-03-29 01:09:13 +01:00
parent 1e72bac223
commit 3a3d58e8a0
3 changed files with 13 additions and 6 deletions

View File

@@ -135,6 +135,8 @@ function CachedDataHandler.CalculateBothHandsFeasibility()
getCore():addKeyBinding(interactStr, Keyboard.KEY_NONE) getCore():addKeyBinding(interactStr, Keyboard.KEY_NONE)
else else
TOC_DEBUG.print("Re-enabling interact key") TOC_DEBUG.print("Re-enabling interact key")
if not CachedDataHandler.interactKey then CachedDataHandler.interactKey = getCore():getKey(interactStr) end
getCore():addKeyBinding(interactStr, CachedDataHandler.interactKey) getCore():addKeyBinding(interactStr, CachedDataHandler.interactKey)
end end
end end

View File

@@ -60,13 +60,21 @@ end
---@param player IsoGameCharacter ---@param player IsoGameCharacter
---@param zombie IsoZombie ---@param zombie IsoZombie
---@param handWeapon HandWeapon
function HandleZombiesAmputations(player, zombie, handWeapon, damage) function HandleZombiesAmputations(player, zombie, handWeapon, damage)
if not instanceof(zombie, "IsoZombie") or not instanceof(player, "IsoPlayer") then return end if not instanceof(zombie, "IsoZombie") or not instanceof(player, "IsoPlayer") then return end
if player ~= getPlayer() then return end if player ~= getPlayer() then return end
-- TODO Check type of weapon. No hands, only knifes or such
if damage < 3 or ZombRand(0,100) < 25 then return end if damage < 3 or ZombRand(0,100) < 25 then return end
TOC_DEBUG.print(handWeapon:getName())
local zombieInv = zombie:getInventory() local zombieInv = zombie:getInventory()
-- Check left or right -- Check left or right
local leftItem = zombieInv:containsEval(PredicateAmputationItemLeft) local leftItem = zombieInv:containsEval(PredicateAmputationItemLeft)

View File

@@ -1,25 +1,22 @@
require('Items/Distributions') require('Items/Distributions')
require('Items/SuburbsDistributions') require('Items/SuburbsDistributions')
--SuburbsDistributions = SuburbsDistributions or {}
-- Insert Prosts and various items in the Medical Clinic loot table -- Insert Prosts and various items in the Medical Clinic loot table
local prosthesisLoot = { local prosthesisLoot = {
[1] = { [1] = {
name = "TOC.Prost_HookArm_L", name = "TOC.Prost_HookArm_L",
chance = 10 chance = 3
}, },
[2] = { [2] = {
name = "TOC.Prost_NormalArm_L", name = "TOC.Prost_NormalArm_L",
chance = 10 chance = 2
}, },
[3] = { [3] = {
name = "TOC.Surg_Arm_Tourniquet_L", name = "TOC.Surg_Arm_Tourniquet_L",
chance = 25 chance = 20
} }
} }