From: Timo Kokkonen Date: Mon, 5 Apr 2010 12:38:32 +0000 (+0300) Subject: create_planets: Initialize also the first planet X-Git-Url: http://git.itanic.dy.fi/?p=sdl-planets;a=commitdiff_plain;h=cef56d7098d9de28507aa6f52c859550770cbe52 create_planets: Initialize also the first planet Signed-off-by: Timo Kokkonen --- diff --git a/planet.c b/planet.c index 2b5c7f0..f72b1b0 100644 --- a/planet.c +++ b/planet.c @@ -73,6 +73,11 @@ void create_planets(struct planet *p, int num, double total_mass, double radius) double sum = 0; struct planet *new_planet; + setup_planet(p, + total_mass / num * 2 * get_random_double(), + total_mass, + radius); + for (i = 0; i < num; i++) { new_planet = malloc(sizeof(*new_planet)); init_planet(new_planet);