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_; };