From af7e06aea89e53357be89de2215863955e389959 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 13 Apr 2021 13:54:28 +0800 Subject: [PATCH] 1 --- server/gameserver/incubator.cc | 16 ++++++++++------ server/gameserver/incubator.h | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/server/gameserver/incubator.cc b/server/gameserver/incubator.cc index fc20f38..09fce62 100644 --- a/server/gameserver/incubator.cc +++ b/server/gameserver/incubator.cc @@ -14,6 +14,11 @@ void Incubator::UnInit() } +void Incubator::AllocAndroid(Human* target, int num) +{ + +} + void Incubator::RecycleAndroid(Human* hum) { Human* nearest_hum = nullptr; @@ -31,18 +36,17 @@ void Incubator::RecycleAndroid(Human* hum) } return true; }); + if (hum->dead) { + hum->RemoveBuffByEffectId(kBET_BeRecycle); + return; + } if (distance < 450) { hum->RemoveBuffByEffectId(kBET_BeRecycle); return; } if (distance > 1450) { hum->RemoveBuffByEffectId(kBET_BeRecycle); - AddHoldHuman(nearest_hum); + hold_humans_.insert(hum); return; } } - -void Incubator::AddHoldHuman(Human* hum) -{ - hold_humans_.insert(hum); -} diff --git a/server/gameserver/incubator.h b/server/gameserver/incubator.h index 3712c2d..ee8c875 100644 --- a/server/gameserver/incubator.h +++ b/server/gameserver/incubator.h @@ -9,10 +9,10 @@ class Incubator void Init(); void UnInit(); + void AllocAndroid(Human* target, int num); void RecycleAndroid(Human* hum); private: - void AddHoldHuman(Human* hum); private: std::set hold_humans_;