From 2f4051d7bde6ebc96fdde349de35f863226392ce Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 22 Aug 2022 19:22:14 +0800 Subject: [PATCH] 1 --- server/gameserver/incubator.cc | 5 +++++ server/gameserver/incubator.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/server/gameserver/incubator.cc b/server/gameserver/incubator.cc index c092083c..6bc54097 100644 --- a/server/gameserver/incubator.cc +++ b/server/gameserver/incubator.cc @@ -255,6 +255,11 @@ void Incubator::SpawnWaveMon(int wave) if (room->IsGameOver()) { return; } + if (room->pve_data.refreshed_mon > 0 && + room->pve_data.mon_num <= 0) { + timeout_ = true; + return; + } auto& mons = room->pve_mode_meta->waves[wave]; for (MetaData::PveGeminiContent* content : mons) { room->xtimer.AddDeadLineTimerAndAttach diff --git a/server/gameserver/incubator.h b/server/gameserver/incubator.h index 5fdcb32e..621ab255 100644 --- a/server/gameserver/incubator.h +++ b/server/gameserver/incubator.h @@ -14,6 +14,7 @@ class Incubator void AllocAndroid(Human* target, int num); void RecycleAndroid(Human* hum); void ActiveAndroid(Human* hum, Human* android); + bool IsTimeOut() { return timeout_; }; private: bool CanSee(Human* hum, Human* exclude_hum); @@ -21,6 +22,7 @@ private: void SpawnWaveMon(int wave); private: + bool timeout_ = false; std::vector hold_humans_; a8::XTimerAttacher xtimer_attacher_; };