From 3fcdc8e2885f407c0f057427ee2f093b6c93e65f Mon Sep 17 00:00:00 2001 From: Allanis Date: Tue, 23 Jul 2013 12:54:19 +0100 Subject: [PATCH] [Fix] Segfault with calculating new position of nebulae with no player. --- src/nebulae.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nebulae.c b/src/nebulae.c index ce9d0a2..8661562 100644 --- a/src/nebulae.c +++ b/src/nebulae.c @@ -13,7 +13,7 @@ #include "pause.h" #include "perlin.h" -#define NEBULAE_Z 16 /* Z plane. */ +#define NEBULAE_Z 4 /* Z plane. */ #define NEBULAE_PUFFS 32 /* Amount of puffs to generate. */ #define NEBULAE_PATH_BG "gen/nebu_bg_%dx%d_%02d.png" @@ -357,7 +357,7 @@ void nebu_renderPuffs(const double dt, int below_player) { (!below_player && (nebu_puffs[i].height > 1.))) { /* Calculate new position. */ - if(!paused) { + if(!paused && (player != NULL)) { nebu_puffs[i].x -= player->solid->vel.x * nebu_puffs[i].height * dt; nebu_puffs[i].y -= player->solid->vel.y * nebu_puffs[i].height * dt; }