diff options
| author | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2021-11-29 23:23:26 +0700 |
|---|---|---|
| committer | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2021-11-29 23:23:26 +0700 |
| commit | 17ea4d827ad8fa1462447d59f490a007ba706d20 (patch) | |
| tree | 4d4c8952a6de825be79427568621cafb66c037ab /src/GameLoop.cpp | |
| parent | 4c7e7136f125ceb5186fdcc0463a6c10990d1111 (diff) | |
| download | blackshades-17ea4d827ad8fa1462447d59f490a007ba706d20.tar.gz | |
Use more efficient PRNG
Diffstat (limited to 'src/GameLoop.cpp')
| -rw-r--r-- | src/GameLoop.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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 <https://www.gnu.org/licenses/>. #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) { |
