]> git.itanic.dy.fi Git - sdl-planets/commitdiff
create_planets: Initialize also the first planet
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Mon, 5 Apr 2010 12:38:32 +0000 (15:38 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Mon, 5 Apr 2010 12:50:04 +0000 (15:50 +0300)
Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
planet.c

index 2b5c7f09217c6726b6c99c98e63fea26e7d288e7..f72b1b0087a523fe76e0f10979fe5cd8d842d7de 100644 (file)
--- 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);