From 80a229baa0148d797f77b27307d5e2f609e68579 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 1 Jun 2020 15:44:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/gameserver/room.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 2ba1030..cb70bb9 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -26,6 +26,7 @@ #include "entityfactory.h" const int ROOM_MAX_PLAYER_NUM = 40; +const int SHUA_RANGE = 731; static long long RoomXGetTickCount(void* context) { @@ -1836,7 +1837,7 @@ void Room::ProcShuaAndroid(int shua_time, int shua_num) a8::Vec2 pos = target->GetPos(); a8::Vec2 dir = a8::Vec2::UP; dir.Rotate(a8::RandAngle()); - pos = pos + dir * 400; + pos = pos + dir * SHUA_RANGE; if (OverBorder(pos, hum->GetRadius())) { pos.x = target->GetPos().x; if (OverBorder(pos, hum->GetRadius())) { @@ -1982,6 +1983,7 @@ void Room::CheckAutoDie(Human* target, }, &target->xtimer_attacher.timer_list_); } else { + bool killed = false; for (auto& pair : human_hash_) { if (pair.second->GetEntityUniId() != target->GetEntityUniId() && pair.second->IsAndroid() && @@ -1993,9 +1995,16 @@ void Room::CheckAutoDie(Human* target, hum->name, hum->curr_weapon->weapon_id); } + killed = true; break; } } + if (!killed) { + a8::UnSetBitFlag(target->status, HS_Disable); + target->BeKill(VP_SafeArea, + "毒圈", + VW_SafeArea); + } } }