From 05cf12e9b01072c90239d2c93fd3c5be99f35e65 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 28 May 2020 19:41:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E5=90=8E=E4=B8=80=E4=B8=AA=E6=9C=BA?= =?UTF-8?q?=E5=99=A8=E4=BA=BA=E7=9B=B4=E6=8E=A5=E8=A2=AB=E6=AF=92=E6=AD=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/gameserver/room.cc | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) 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;