Cast width and height as floats before checking the ratio

This commit is contained in:
Alayan-stk-2 2018-05-02 20:33:08 +02:00 committed by GitHub
parent d6c2cccccd
commit 74a77ed5ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,7 +88,8 @@ RaceGUI::RaceGUI()
// and the map is in a player view, scale down the map
if (race_manager->getNumLocalPlayers() >= 4 && !race_manager->getIfEmptyScreenSpaceExists())
{
if (irr_driver->getFrameSize().Width / irr_driver->getFrameSize().Height > (4.1f/3.0f))
if ( ((float) irr_driver->getFrameSize().Width / (float) irr_driver->getFrameSize().Height) >
(4.1f/3.0f))
{
if (race_manager->getNumLocalPlayers() == 4)
map_size_splitscreen = 0.75f;