From 0784394099451b99a729ad6426dd5a6e0f2c5b61 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 15 Jun 2023 14:43:36 +0800 Subject: [PATCH] 1 --- server/gameserver/human.cc | 7 +++++++ server/gameserver/incubator.cc | 15 ++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index ba5d0077..50c779c2 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -167,6 +167,13 @@ void Human::CarShot(const glm::vec3& target_dir) void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id, int real_killer_id, const std::string& real_killer_name) { + #ifdef DEBUG + { + if (a8::HasBitFlag(status, CS_CrazeMode)) { + int i = 0; + } + } + #endif if (!dead && !room->IsGameOver() && !real_dead && !a8::HasBitFlag(status, CS_PreDieSuspended)) { GetTrigger()->PreDie(killer_id, weapon_id); #ifdef DEBUG diff --git a/server/gameserver/incubator.cc b/server/gameserver/incubator.cc index 9b16ee97..570ffe97 100644 --- a/server/gameserver/incubator.cc +++ b/server/gameserver/incubator.cc @@ -92,6 +92,10 @@ void Incubator::AllocAndroid(Human* target, int num, std::vector* androi if (room->GetFrameNo() < wait_alloc_time_ * SERVER_FRAME_RATE) { return; } + if (hold_humans_.size() <= 6 && room->GetGasData().new_area_meta->GetSmallRingCount() < 3) { + ShowHand(); + return; + } #if 1 num = 1; #endif @@ -152,9 +156,6 @@ void Incubator::AllocAndroid(Human* target, int num, std::vector* androi room->BroadcastDebugMsg(a8::Format("投放机器人 分配失败 %d", {hold_humans_.size()})); } #endif - if (hold_humans_.size() <= 6 && room->GetGasData().new_area_meta->GetSmallRingCount() < 3) { - ShowHand(); - } } void Incubator::RecycleAndroid(Human* hum) @@ -214,7 +215,11 @@ bool Incubator::CanSee(Human* hum, Human* exclude_hum) ( [target, exclude_hum, &can_see] (Human* hum) -> bool { +#if 1 + { +#else if (hum != exclude_hum) { +#endif if (target->GetPos().ManhattanDistance2D(hum->GetPos()) < mt::Param::s().incubator_canset_distance) { can_see = true; @@ -232,7 +237,7 @@ void Incubator::AutoAllocAndroid() case GasWaiting: case GasMoving: { - if (!hold_humans_.empty() && room->AliveCount() > 6) { + if (!hold_humans_.empty() && hold_humans_.size() > 6) { Human* hum = hold_humans_[0]; if (room->GetGasData().GetGasMode() == GasWaiting && hold_humans_.size() > 1 && @@ -479,7 +484,7 @@ void Incubator::NextWave() void Incubator::ShowHand() { #ifdef DEBUG - a8::XPrintf("ShowHand\n", {}); + a8::XPrintf("ShowHand hold_humans_.size:%d\n", {hold_humans_.size()}); #endif for (auto& hum : hold_humans_) { glm::vec3 point = glm::vec3(room->GetGasData().new_area_meta->GetLastArea()->x1(),