Custom Asteroids

Custom Asteroids

21.6k Downloads

Duna.psol gives error

Starstrider42 opened this issue ยท 0 comments

commented

Background Info

  • Operating System: Windows 10 64-bit
  • KSP Version: 1.6.1
  • Custom Asteroids Version: post-1.6.0 developer build

Issue Description

The following config block:

INTERCEPT
{
	name = groupB
	title = Paired <<1>>

	spawnRate = 1.0

	targetBody = Duna

	approach
	{
		type = ImpactParameter
		max = Ratio(Duna.soi, 0.5)
	}

	warnTime
	{
		dist = Uniform
		min = Ratio(Duna.psol,  50)
		max = Ratio(Duna.psol, 220)
	}
}

will not load in Custom Asteroids, giving the following error:

Celestial body 'Duna' does not have a solar day.

The culprit is the CelestialBody.solarRotationPeriod property, which I assumed indicates that a celestial body has a well-defined solar day (i.e., is not the Sun or a tidally locked planet) but, in the stock game, is set only for Kerbin. Fix the code so that psol returns the correct solar day for both non-Kerbin planets and moons.