From 9ed8ef3273c9bdecf7ac6c2ad2fc1b0ab60f26f6 Mon Sep 17 00:00:00 2001 From: MarcEricMartel Date: Sun, 3 Dec 2023 11:14:08 -0500 Subject: [PATCH] Moar random? --- SQCSim-srv/server.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SQCSim-srv/server.cpp b/SQCSim-srv/server.cpp index 7b1f0e7..c4af364 100644 --- a/SQCSim-srv/server.cpp +++ b/SQCSim-srv/server.cpp @@ -200,7 +200,8 @@ void Server::Run() { m_world->BuildWorld(); for (auto& [key, conn] : m_players) { // Creation des instances de joueurs et premier sync. - int x = rand() % (CHUNK_SIZE_X + WORLD_SIZE_X - 1), y = rand() % (CHUNK_SIZE_Y + WORLD_SIZE_Y - 1); + int x = (rand() % (CHUNK_SIZE_X * WORLD_SIZE_X - 1)) - (CHUNK_SIZE_X * WORLD_SIZE_X / 2), + y = (rand() % (CHUNK_SIZE_Y * WORLD_SIZE_Y - 1)) - (CHUNK_SIZE_Y * WORLD_SIZE_Y / 2); conn->player = std::make_unique(Vector3f(x + .5f, CHUNK_SIZE_Y + 1.8f, y + .5f)); Sync sync; sync.position = conn->player->GetPositionAbs();