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