diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 4283ac0..a562977 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -2137,8 +2137,26 @@ void Room::ProcDieAndroid(int die_time, int die_num) { Android* hum = (Android*)pair.second; alive_humans.push_back(hum); + if (alive_humans.size() > 10) { + break; + } } } + { + Human* first_alive_player = nullptr; + for (auto& pair : accountid_hash_) { + if (!pair.second->real_dead) { + first_alive_player = pair.second; + break; + } + } + std::sort(alive_humans.begin(), alive_humans.end(), + [first_alive_player] (Human* a, Human* b ) + { + return first_alive_player->GetPos().ManhattanDistance(a->GetPos()) > + first_alive_player->GetPos().ManhattanDistance(b->GetPos()); + }); + } int dead_num = 0; int try_count = 0; std::vector alive_humans_copy = alive_humans;