From 981dfb168fc06a7d0f22f775590eff150f3318cb Mon Sep 17 00:00:00 2001 From: torcs-ng Date: Sun, 24 Apr 2011 18:37:25 +0000 Subject: [PATCH] fix bug moon position bad initialized git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@3509 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 3d2010287c9888d529e9f7655b364c6916d800f4 Former-commit-id: d68e008d8da9bb4303cfc424dd257d1324debb0d --- src/modules/graphic/ssggraph/grbackground.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/graphic/ssggraph/grbackground.cpp b/src/modules/graphic/ssggraph/grbackground.cpp index c45881ea..59f38050 100755 --- a/src/modules/graphic/ssggraph/grbackground.cpp +++ b/src/modules/graphic/ssggraph/grbackground.cpp @@ -230,10 +230,10 @@ grInitBackground(void) // Add the Moon TheCelestBodies[eCBMoon] = TheSky->addBody ( "data/textures/moon.rgba",NULL, (2500 / div), grSkyDomeDistance); - if ( grSunDeclination < 0 ) + if ( grSunDeclination > 180 ) grMoonDeclination = 3.0 + (rand() % 40); else - grMoonDeclination = -(rand() % 180) + 90; + grMoonDeclination = (rand() % 270); const float moonAscension = (float)(rand() % 359);