Fix access range
This commit is contained in:
@@ -1,7 +1,23 @@
|
|||||||
-- luacheck: globals MyModGlobal Character
|
-- luacheck: globals MyModGlobal Character Hook EnsurePatch
|
||||||
local utils = require "Cyka.utils"
|
local utils = require "Cyka.utils"
|
||||||
local dump = require "Cyka.dump"
|
local dump = require "Cyka.dump"
|
||||||
|
|
||||||
|
Hook.Add("Character_CanInteractWith_Item_Postfix", "YourModName.AllowRemoteInteraction", function()
|
||||||
|
return true
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- Then patch the CanInteractWith method
|
||||||
|
Hook.Patch("YourModName", "Barotrauma.Character", "CanInteractWith",
|
||||||
|
{ "Barotrauma.Item", "System.Single&", "System.Boolean" },
|
||||||
|
function(_, ptable)
|
||||||
|
local result = Hook.Call("Character_CanInteractWith_Item_Postfix")
|
||||||
|
if result == true then
|
||||||
|
ptable.ReturnValue = true
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
Hook.HookMethodType.After
|
||||||
|
)
|
||||||
|
|
||||||
local function tryAccessFabricator()
|
local function tryAccessFabricator()
|
||||||
local items = utils.enqueueAllSubmarineItems({}, function(item)
|
local items = utils.enqueueAllSubmarineItems({}, function(item)
|
||||||
return item.Prefab.Identifier.Value == "fabricator", item.Prefab.Identifier.Value == "fabricator"
|
return item.Prefab.Identifier.Value == "fabricator", item.Prefab.Identifier.Value == "fabricator"
|
||||||
|
Reference in New Issue
Block a user