Sensible behaviour for setSunSkimStartCoordinates and setSunSkimEndCoordinates in interstellar space. New AI message: NO_SUN_FOUND.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4549 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Jens Ayton 2011-05-09 20:41:28 +00:00
parent abe7913824
commit 74f23e6f81

View File

@ -1671,9 +1671,15 @@ MA 02110-1301, USA.
- (void) setSunSkimStartCoordinates
{
if ([UNIVERSE sun] == nil)
{
[shipAI message:@"NO_SUN_FOUND"];
return;
}
Vector v0 = [UNIVERSE getSunSkimStartPositionForShip:self];
if ((v0.x != 0.0)||(v0.y != 0.0)||(v0.z != 0.0))
if (!vector_equal(v0, kZeroVector))
{
coordinates = v0;
[shipAI message:@"APPROACH_COORDINATES"];
@ -1687,6 +1693,12 @@ MA 02110-1301, USA.
- (void) setSunSkimEndCoordinates
{
if ([UNIVERSE sun] == nil)
{
[shipAI message:@"NO_SUN_FOUND"];
return;
}
coordinates = [UNIVERSE getSunSkimEndPositionForShip:self];
[shipAI message:@"APPROACH_COORDINATES"];
}