diff --git a/src/server/server.cpp b/src/server/server.cpp index f317b535..990ae0cd 100644 --- a/src/server/server.cpp +++ b/src/server/server.cpp @@ -302,34 +302,31 @@ std::chrono::milliseconds Server::doTick() { sendUpdateToAllClients(Event(this->world_eid, EventType::LoadGameState, LoadGameStateEvent(partial_update))); } + std::cout << "Assigned player " + std::to_string(index) + " to be the DM" << std::endl; + } - int player_idx = 0; // only increment when assigning a model - - auto players = this->state.objects.getPlayers(); - for (int i = 0; i < players.size(); i++) { - auto player = players.get(i); - if (player == nullptr) continue; - - if (player_idx == 0) { - std::cout << "assigning player " << i << " to fire\n"; - player->modelType = ModelType::PlayerFire; - } else if (player_idx == 1) { - std::cout << "assigning player " << i << " to lightning\n"; - player->modelType = ModelType::PlayerLightning; - } else if (player_idx == 2) { - std::cout << "assigning player " << i << " to water\n"; - player->modelType = ModelType::PlayerWater; - } + int player_idx = 0; // only increment when assigning a model - player_idx++; + auto players = this->state.objects.getPlayers(); + for (int i = 0; i < players.size(); i++) { + auto player = players.get(i); + if (player == nullptr) continue; - if (player_idx > 2) { - player_idx = 0; - } + if (player_idx == 0) { + player->modelType = ModelType::PlayerFire; + } + else if (player_idx == 1) { + player->modelType = ModelType::PlayerLightning; + } + else if (player_idx == 2) { + player->modelType = ModelType::PlayerWater; } - std::cout << "Assigned player " + std::to_string(index) + " to be the DM" << std::endl; - std::cout << "Starting game!" << std::endl; + player_idx++; + + if (player_idx > 2) { + player_idx = 0; + } } if (this->config.server.skip_intro) {