Compat for FH
This commit is contained in:
9
.vscode/tasks.json
vendored
9
.vscode/tasks.json
vendored
@@ -50,6 +50,15 @@
|
||||
"problemMatcher": [
|
||||
"$eslint-stylish"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Run Zomboid Test Server 2",
|
||||
"options": {"statusbar": {"label": "$(run) Zomboid Server (TOC+FH+BH)"}},
|
||||
"type": "shell",
|
||||
"command":"\"${config:zomboid_server_folder}\\StartServer64_nosteam_custom.bat\" TOC_FH_BH",
|
||||
"problemMatcher": [
|
||||
"$eslint-stylish"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,14 +1,38 @@
|
||||
|
||||
--* BRUTAL HANDS -- *
|
||||
|
||||
local function HandleModCompatibility()
|
||||
|
||||
if getActivatedMods():contains('BrutalHandwork') then
|
||||
--* BRUTAL HANDS -- *
|
||||
--[[
|
||||
Brutal hands has a TOC_COMPAT but its check is wrong and uses an old API.
|
||||
]]
|
||||
|
||||
local activatedMods = getActivatedMods()
|
||||
TOC_DEBUG.print("Checking for mods compatibility")
|
||||
|
||||
if activatedMods:contains('BrutalHandwork') then
|
||||
TOC_DEBUG.print("found BrutalHandwork, activating compat module")
|
||||
BrutalHands = BrutalHands or {}
|
||||
BrutalHands.TOC = require("TOC/API")
|
||||
|
||||
-- Brutal hands has a TOC_COMPAT but its check is wrong and uses an old API.
|
||||
end
|
||||
if activatedMods:contains('FancyHandwork') then
|
||||
TOC_DEBUG.print("found FancyHandwork, activating compat module")
|
||||
|
||||
require("TimedActions/FHSwapHandsAction")
|
||||
local og_FHSwapHandsAction_isValid = FHSwapHandsAction.isValid
|
||||
function FHSwapHandsAction:isValid()
|
||||
local tocApi = require("TOC/API")
|
||||
if tocApi.hasBothHands(self.character) then
|
||||
return og_FHSwapHandsAction_isValid(self)
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Events.OnGameStart.Add(HandleModCompatibility)
|
||||
|
||||
Reference in New Issue
Block a user