Skip to content

Instantly share code, notes, and snippets.

@scfmod
scfmod / function_observe_script.lua
Created December 20, 2018 18:16
Observe function calls
---@param fSrc function
---@param fDst function
---@param fResultCallback function
function hook(fSrc, fDst, fResultCallback)
return function(...)
--DebugUtil.printCallingFunctionLocation()
if type(fResultCallback) == 'function' then
if type(fDst) == 'function' then
fDst(...)
end
@scfmod
scfmod / script.lua
Last active December 29, 2018 17:00
PlaceAnywhere - Land owner check override and terrainDeformation override
local overrideAreaOwnerCheck = false
local dismissTerrainDeformation = false
-- ...
function PlaceAnywhere:loadMap(name)
-- ...
-- override area owner check
PlacementScreenController.isPlacementValid = Utils.overwrittenFunction(PlacementScreenController.isPlacementValid, PlaceAnywhere.isPlacementValid);