From cef56d7098d9de28507aa6f52c859550770cbe52 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Mon, 5 Apr 2010 15:38:32 +0300 Subject: [PATCH] create_planets: Initialize also the first planet Signed-off-by: Timo Kokkonen --- planet.c | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.45.0