Fixed another multiple star system bug related to sharing of StarDetails objects.

Some stars without orbit barycenters could end up (incorrectly) getting assigned
a barycenter.
ver1_5_1
Chris Laurel 2008-01-15 01:20:06 +00:00
parent baae4530f7
commit 7a5c9ed95c
1 changed files with 3 additions and 0 deletions

View File

@ -1062,11 +1062,14 @@ void Star::setLuminosity(float lum)
void Star::setDetails(StarDetails* sd)
{
// TODO: delete existing details if they aren't shared
details = sd;
}
void Star::setOrbitBarycenter(Star* s)
{
if (details->shared())
details = new StarDetails(*details);
details->setOrbitBarycenter(s);
}