Closed Lisias closed 1 year ago
This issue is INVALID. There's an error on the reference code!!
This is wrong, the .ToString()
is being applied on the wrong place:
Log.force("{0}", ConfigNodeWithSteroids.from(cn.GetNode("LetsStayTogether").ToString()));
Is should be:
Log.force("{0}", ConfigNodeWithSteroids.from(cn.GetNode("LetsStayTogether")).ToString());
And, now, this works fine, as I had proved while checking https://github.com/net-lisias-ksp/DistantObject/issues/28:
[LOG 00:23:34.929] DOE *****
source root
{
debugMode = False
useToolbar = True
useAppLauncher = True
onlyInSpaceCenter = False
DistantFlare
{
flaresEnabled = False
flareSaturation = 1
flareSize = 1
flareBrightness = 1
ignoreDebrisFlare = False
debrisBrightness = 0.150000006
situations = ORBITING,SUB_ORBITAL,ESCAPING,DOCKED,FLYING
showNames = True
}
DistantVessel
{
renderVessels = False
maxDistance = 750000
renderMode = 0
ignoreDebris = False
}
SkyboxBrightness
{
changeSkybox = True
maxBrightness = 0.25
referenceBodySize = 1
minimumSignificantBodySize = 1
minimumTargetRelativeAngle = 100
}
}
target root
{
debugMode = False
useToolbar = True
useAppLauncher = True
onlyInSpaceCenter = False
DistantFlare
{
flaresEnabled = False
flareSaturation = 1
flareSize = 1
flareBrightness = 1
ignoreDebrisFlare = False
debrisBrightness = 0.150000006
situations = ORBITING,SUB_ORBITAL,ESCAPING,DOCKED,FLYING
showNames = True
}
DistantVessel
{
renderVessels = False
maxDistance = 750000
renderMode = 0
ignoreDebris = False
}
SkyboxBrightness
{
changeSkybox = True
maxBrightness = 0.25
referenceBodySize = 1
minimumSignificantBodySize = 1
minimumTargetRelativeAngle = 100
}
}
using this code:
ConfigNodeWithSteroids settings = ConfigNodeWithSteroids.from(configNode);
UnityEngine.Debug.LogFormat("DOE *****\n source {0}\n target {1}", configNode, settings);
That's weird.
Let's say we have the following ConfigNode on the prefab:
The following code works fine:
and prints what's expected correctly. However, the following code:
ends up printing what follows on the log:
what's clearly a bug, because both entries should be printing the same content!
By some reason,
ConfigNodeWithSteroids.from
is borking when being fed with a subnode!Search and Destroy the bug!