From a7ffcdfd06489d67ba52e8e3a840ffcfa4220d4f Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 30 Sep 2022 10:25:52 +0800 Subject: [PATCH] 1 --- server/gameserver/incubator.cc | 6 +++++- server/gameserver/incubator.h | 1 + server/gameserver/room.cc | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/server/gameserver/incubator.cc b/server/gameserver/incubator.cc index 5257aab4..eb2eb4a9 100644 --- a/server/gameserver/incubator.cc +++ b/server/gameserver/incubator.cc @@ -21,10 +21,14 @@ void Incubator::Init() incubator->AutoAllocAndroid(); }, &xtimer_attacher_.timer_list_); +} + +void Incubator::InitPve() +{ if (room->IsPveRoom()) { room->pve_data.max_wave = room->pve_mode_meta->mode_time.size(); int wave = 0; - int total_time = room->GetGasInactiveTime() * 1000; + int total_time = 0; SpawnWaveMon(0); for (int time : room->pve_mode_meta->mode_time) { total_time += time; diff --git a/server/gameserver/incubator.h b/server/gameserver/incubator.h index 9164ed34..4fd5bde0 100644 --- a/server/gameserver/incubator.h +++ b/server/gameserver/incubator.h @@ -11,6 +11,7 @@ class Incubator void Init(); void UnInit(); + void InitPve(); void AllocAndroid(Human* target, int num); void RecycleAndroid(Human* hum); void ActiveAndroid(Human* hum, Human* android); diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 9aa0546e..8d46fb90 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -1342,6 +1342,7 @@ void Room::UpdateGasInactivePve() OnBattleStart(); NotifyGameStart(); InitAndroidAI(); + incubator_->InitPve(); } } @@ -2443,7 +2444,7 @@ long long Room::GetGasInactiveTime() App::Instance()->debug_params[1] : 10; #endif if (IsPveRoom()) { - return 0; + return 10; } else { return MetaMgr::Instance()->gas_inactive_time; }