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]);