This commit is contained in:
aozhiwei 2022-08-25 17:48:10 +08:00
parent 2518ac0410
commit 70e89667b0
2 changed files with 5 additions and 5 deletions

View File

@ -248,7 +248,7 @@ void Incubator::OnEnterNewWave(int wave)
return; return;
} }
room->pve_data.wave = wave + 1; room->pve_data.wave = wave + 1;
room->OnEnterNewWave(wave); room->OnEnterNewWave(wave + 1);
if (wave < 0) { if (wave < 0) {
abort(); abort();
} }
@ -320,11 +320,11 @@ void Incubator::SpawnWaveMon(int wave)
int Incubator::GetPveLeftTime() int Incubator::GetPveLeftTime()
{ {
if (room->pve_data.wave >= wave_timers_.size() || if (room->pve_data.wave > wave_timers_.size() ||
room->pve_data.wave < 0) { room->pve_data.wave < 0) {
abort(); return 0;
} }
xtimer_list* timer = wave_timers_[room->pve_data.wave]; xtimer_list* timer = wave_timers_[room->pve_data.wave - 1];
int remain_time = room->xtimer.GetRemainTime(timer); int remain_time = room->xtimer.GetRemainTime(timer);
return remain_time * FRAME_RATE_MS; return remain_time * FRAME_RATE_MS;
} }

View File

@ -4110,7 +4110,7 @@ bool Room::IsSurvivalRoom()
void Room::OnEnterNewWave(int wave) void Room::OnEnterNewWave(int wave)
{ {
if (IsDestoryRoom() && wave > 0) { if (IsDestoryRoom() && wave > 0 && wave < pve_mode_meta->area.size()) {
gas_data_.gas_mode = GasWaiting; gas_data_.gas_mode = GasWaiting;
gas_data_.gas_start_frameno = GetFrameNo(); gas_data_.gas_start_frameno = GetFrameNo();
battle_start_frameno_ = GetFrameNo(); battle_start_frameno_ = GetFrameNo();