Skip to content

Commit

Permalink
more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Timmeey86 committed Aug 23, 2024
1 parent ec24f37 commit f445088
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modDesc.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<modDesc descVersion="79">
<author>Farmsim Tim</author>
<version>1.0.0.6</version>
<version>1.0.0.7</version>
<title>
<en>A Height Type Debugger</en>
<de>A Height Type Debugger</de>
Expand Down
10 changes: 10 additions & 0 deletions scripts/HeightTypeDebugger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ DensityMapHeightManager.addDensityMapHeightType = Utils.prependedFunction(Densit
end
end)

local numChannelsBefore = 0

DensityMapHeightManager.loadDensityMapHeightTypes = Utils.prependedFunction(DensityMapHeightManager.loadDensityMapHeightTypes, function(manager, xmlFile, missionInfo, baseDirectory, isBaseType)

local source = "unknown source"
if xmlFile ~= nil then
source = getXMLFilename(xmlFile)
Expand All @@ -44,10 +47,17 @@ DensityMapHeightManager.loadDensityMapHeightTypes = Utils.prependedFunction(Dens
currentXMLFile = source
currentIndex = currentIndex + 1
end

print("Loading height types from " .. tostring(source))
numChannelsBefore = g_densityMapHeightManager.heightTypeNumChannels or 0 -- will be nil before loading base game stuff
end)

DensityMapHeightManager.loadDensityMapHeightTypes = Utils.appendedFunction(DensityMapHeightManager.loadDensityMapHeightTypes, function(...)
currentXMLFile = nil

if g_densityMapHeightManager.heightTypeNumChannels < numChannelsBefore then
Logging.error("The number of density height types was decreased by the mod above")
end
end)

local function getModName(path)
Expand Down

0 comments on commit f445088

Please sign in to comment.