diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index a562977..00f58b1 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -2137,7 +2137,7 @@ void Room::ProcDieAndroid(int die_time, int die_num) { Android* hum = (Android*)pair.second; alive_humans.push_back(hum); - if (alive_humans.size() > 10) { + if (alive_humans.size() > 20) { break; } } @@ -2150,12 +2150,24 @@ void Room::ProcDieAndroid(int die_time, int die_num) 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()); - }); + if (first_alive_player) { + 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()); + }); + } + } + { + if (alive_humans.size() == 1) { + Human* hum = alive_humans[0]; + hum->BeKill(VP_SafeArea, + "毒圈", + VW_SafeArea); + a8::UnSetBitFlag(hum->status, HS_Disable); + return; + } } int dead_num = 0; int try_count = 0;