Page 1 of 1

Modify, Add, Replace don't work for Locations

Posted: 02.05.2006, 12:04
by Vincent
I've added the infoImage and InfoText functions to Locations. It works perfectly when I add the InfoImage and InfoText strings directly into the definition of the location in the original .ssc file.
But it is more handy to create a new .ssc file and use the "Modify" disposition. Unfortunately, the "Modify", "Add", and "Replace" dispositions don't work for Locations, whereas they should according to Chris' comments at the beginning of the solarsys.cpp file :

/*!
Solar system catalog (.ssc) files contain items of three different types:
bodies, locations, and alternate surfaces. Bodies [are] planets, moons, asteroids,
comets, and spacecraft. Locations are points on the surfaces of bodies which
may be labelled but aren't rendered. Alternate surfaces are additional
surface definitions for bodies.

An ssc file contains zero or more definitions of this form:

\code
[disposition] [item type] "name" "parent name"
{
...object info fields...
}
\endcode

The disposition of the object determines what happens if an item with the
same parent and same name already exists. It may be one of the following:
- Add - Default if none is specified. Add the item even if one of the
same name already exists.
- Replace - Replace an existing item with the new one
- Modify - Modify the existing item, changing the fields that appear
in the new definition.

All dispositions are equivalent to add if no item of the same name
already exists.

The item type is one of Body, Location, or AltSurface, defaulting to
Body when no type is given.

The name and parent name are both mandatory.
*/


You can try to reproduce this bug on your system with this short arctic_test.ssc file (no need to use the InfoText/InfoImage functions) :

Code: Select all

Modify Location "ARCTIC OCEAN" "Sol/Earth"
{
    LongLat [ 0 0 0 ] # instead of [ 0 90 0 ]
}

The ARTCIC OCEAN's latitude is still 90?°N whereas it should be modified to 0?°...