From 1a96510801521fea7c5efe009e223a334eeabcf3 Mon Sep 17 00:00:00 2001 From: Vectozavr <60608292+vectozavr@users.noreply.github.com> Date: Sun, 7 Nov 2021 14:48:59 +0700 Subject: [PATCH] add standard white & dark colors in ShooterConsts.h --- Shooter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Shooter.cpp b/Shooter.cpp index 66381c7..2cdc883 100644 --- a/Shooter.cpp +++ b/Shooter.cpp @@ -276,8 +276,8 @@ void Shooter::spawnPlayer(sf::Uint16 id) { world->body(ObjectNameTag(name + "_foot_2"))->translate(Vec3D{0.25, 0, 0}); newPlayer->attach(world->body(ObjectNameTag(name + "_foot_2"))); - int colorBodyNum = (int) ((double) (rand()-1) / RAND_MAX * 5); - int colorFootNum = (int) ((double) (rand()-1) / RAND_MAX * 5); + int colorBodyNum = static_cast (static_cast((rand()-1)) / RAND_MAX * 5.0); + int colorFootNum = static_cast (static_cast((rand()-1)) / RAND_MAX * 5.0); newPlayer->setColor(ShooterConsts::WHITE_COLORS[colorBodyNum]); world->body(ObjectNameTag(name + "_foot_1"))->setColor(ShooterConsts::DARK_COLORS[colorFootNum]);