From 981c91d702e932d7a25a9809060aef161ac00bd0 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 1 Oct 2013 01:48:43 +0200 Subject: [PATCH] Fixed gswe_moment_calculate_planet() so it now understands Asc, MC and Vertex --- src/gswe-moment.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/gswe-moment.c b/src/gswe-moment.c index 138bd6c..1766c2d 100644 --- a/src/gswe-moment.c +++ b/src/gswe-moment.c @@ -675,16 +675,27 @@ gswe_moment_calculate_planet(GsweMoment *moment, GswePlanet planet, GError **err return; } - // TODO: This function should know about Ascendant, MC and Vertex, so it could calculate their positions, too - if (planet_data->planet_info->real_body == FALSE) { - g_warning("The position data of planet %d can not be calculated by this function", planet); - - return; - } - swe_set_topo(moment->priv->coordinates.longitude, moment->priv->coordinates.latitude, moment->priv->coordinates.altitude); jd = gswe_timestamp_get_julian_day(moment->priv->timestamp, err); + if (planet_data->planet_info->real_body == FALSE) { + if ( + (planet_data->planet_info->planet != GSWE_PLANET_ASCENDENT) + && (planet_data->planet_info->planet != GSWE_PLANET_MC) + && (planet_data->planet_info->planet != GSWE_PLANET_VERTEX) + ) { + g_warning("The position data of planet %d can not be calculated by this function", planet); + + return; + } else { + // gswe_moment_calculate_house_positions() calculates house cusp + // positions, together with Ascendant, MC and Vertex points + gswe_moment_calculate_house_positions(moment, err); + + return; + } + } + if ((err) && (*err)) { return; }