From 17ea4d827ad8fa1462447d59f490a007ba706d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Mon, 29 Nov 2021 23:23:26 +0700 Subject: Use more efficient PRNG --- src/GameLoop.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/GameLoop.cpp') diff --git a/src/GameLoop.cpp b/src/GameLoop.cpp index 3364bc2..9aaff92 100644 --- a/src/GameLoop.cpp +++ b/src/GameLoop.cpp @@ -20,7 +20,7 @@ // along with Black Shades. If not, see . #include "Game.h" -#include "Support.h" +#include "misc.h" extern float multiplier; extern int thirdperson; @@ -194,9 +194,9 @@ void handleKey(Game* game, int key, int action, int mods) 0, person.playerrotation, 0); joint.velocity += person.velocity; joint.velocity += facing * 50; - joint.velocity.x += abs(Random() % 20) - 10; - joint.velocity.y += abs(Random() % 20) - 10; - joint.velocity.z += abs(Random() % 20) - 10; + joint.velocity.x += randInt(-9, 9); + joint.velocity.y += randInt(-9, 9); + joint.velocity.z += randInt(-9, 9); } } } else if (key == keymap.switch_weapon) { -- cgit v1.2.3