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)
else
TOC_DEBUG.print("Re-enabling interact key")
if not CachedDataHandler.interactKey then CachedDataHandler.interactKey = getCore():getKey(interactStr) end
getCore():addKeyBinding(interactStr, CachedDataHandler.interactKey)
end
end

View File

@@ -60,13 +60,21 @@ end
---@param player IsoGameCharacter
---@param zombie IsoZombie
---@param handWeapon HandWeapon
function HandleZombiesAmputations(player, zombie, handWeapon, damage)
if not instanceof(zombie, "IsoZombie") or not instanceof(player, "IsoPlayer") 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
TOC_DEBUG.print(handWeapon:getName())
local zombieInv = zombie:getInventory()
-- Check left or right
local leftItem = zombieInv:containsEval(PredicateAmputationItemLeft)