diff --git a/src/cutscene.cpp b/src/cutscene.cpp index 429ad8c..5ecd41c 100644 --- a/src/cutscene.cpp +++ b/src/cutscene.cpp @@ -403,8 +403,8 @@ void cutscene_init(int scene) { explosion_addEngine(&aliens[i]); if (scene == 0 && i > 0 && (timer % 15) == i) { - aliens[i].dx += (drand48() - 0.5) * 0.1; - aliens[i].dy += (drand48() - 0.5) * 0.1; + aliens[i].dx += (DRAND - 0.5) * 0.1; + aliens[i].dy += (DRAND - 0.5) * 0.1; if (aliens[i].x > 500 - timer) aliens[i].dx -= 0.2; if (aliens[i].x < 0) diff --git a/src/defs.h b/src/defs.h index 3187fc2..9c58004 100644 --- a/src/defs.h +++ b/src/defs.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012 Guus Sliepen -Copyright (C) 2012, 2015, 2016 Julie Marchant +Copyright (C) 2012, 2015-2017 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -33,6 +33,7 @@ along with this program. If not, see . ((x) + (y) > (b) ? ((a) - (b)) : 0)) #define CHANCE(x) ((rand() % RAND_MAX) < ((x) * RAND_MAX)) #define RANDRANGE(x, y) (((x) < (y)) ? ((x) + (rand() % (long)(1 + (y) - (x)))) : (x)) +#define DRAND ((double)rand() / RAND_MAX) // Compile-time options