Commit 86bd7068 authored by Harmonikater's avatar Harmonikater
Browse files

Fix bf2_howManyLodsDoIHave function

parent c8769e7c
Pipeline #8108 passed with stage
in 34 seconds
......@@ -155,27 +155,34 @@ fn bf2_howManyLodsDoIHave obj geomLevel:0 lodNodes:undefined=
if obj.children.count > geomLevel then
(
local geom = obj.children[geomLevel+1]
local geom = getChildWithSubStr obj ("geom" + (geomLevel as string))
if geom == undefined then
(
format "ERROR! bf2_howManyLodsDoIHave() child # % does not exist on: %!\n" obj (geomLevel+1)
format "ERROR! bf2_howManyLodsDoIHave() geom % does not exist on: %!\n" (geomLevel) obj
)
else
(
retVal = geom.children.count
if classof lodNodes == array then
if geom.children.count > 0 then
(
lodNodes.count = retVal
for i=1 to retVal do
lodNodes[i] = geom.children[i]
local lod = 0
for child in geom.children do
(
if matchPattern child.name pattern:"lod*" then
(
lod = child.name[4] as integer
if retVal < lod do retVal = lod
if classof lodNodes == array then
(
lodNodes[lod] = child
)
)
)
)
)
)
return retVal
return (retVal+1)
)
fn bf2SaveLMsizesToFile fname =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment