From 2f0150c09830a92a7c0b34bb10199990a47a0907 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 14 Jun 2021 17:42:26 +0200 Subject: [PATCH] Fixing players starting position --- sources/System/Lobby/LobbySystem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/System/Lobby/LobbySystem.cpp b/sources/System/Lobby/LobbySystem.cpp index 3f9df0c7..f897fc3c 100644 --- a/sources/System/Lobby/LobbySystem.cpp +++ b/sources/System/Lobby/LobbySystem.cpp @@ -160,8 +160,8 @@ namespace BBM continue; auto &player = Runner::createPlayer(*scene); _addController(player, lobby.layout); - player.getComponent().position = Vector3f(mapWidth * playerCount % 2, 0, - static_cast(mapHeight * playerCount / 2)); + player.getComponent().position = Vector3f(mapWidth * (playerCount % 2), 0, + mapHeight * ((playerCount + 1) % 2)); auto *model = dynamic_cast(player.getComponent().drawable.get()); model->setTextureToMaterial(MAP_DIFFUSE, "assets/player/textures/" + _colors[lobby.color] + ".png"); playerCount++;