This commit is contained in:
aozhiwei 2022-08-23 15:02:12 +08:00
parent 01ce1e4fe1
commit ee6df70741
3 changed files with 9 additions and 4 deletions

View File

@ -288,7 +288,7 @@ void Hero::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
&xtimer_attacher.timer_list_); &xtimer_attacher.timer_list_);
if (room->IsPveRoom()) { if (room->IsPveRoom()) {
--room->pve_data.mon_num; --room->pve_data.mon_num;
--room->pve_data.killed_num; ++room->pve_data.killed_num;
room->NotifyUiUpdate(); room->NotifyUiUpdate();
} }
GetTrigger()->Die(); GetTrigger()->Die();

View File

@ -256,7 +256,7 @@ void Incubator::SpawnWaveMon(int wave)
abort(); abort();
} }
if (room->pve_data.refreshed_mon > 0 && if (room->pve_data.refreshed_mon > 0 &&
room->pve_data.mon_num <= 0) { room->pve_data.mon_num > 0) {
timeout_ = true; timeout_ = true;
return; return;
} }

View File

@ -1187,8 +1187,13 @@ void Room::UpdateGas()
if (gas_data_.gas_mode != GasInactive) { if (gas_data_.gas_mode != GasInactive) {
if (IsPveRoom()) { if (IsPveRoom()) {
if (!IsGameOver() && if (!IsGameOver() &&
pve_data.refreshed_mon > 0 && (
pve_data.killed_num >= pve_data.refreshed_mon) { incubator_->IsTimeOut() ||
(
pve_data.refreshed_mon > 0 &&
pve_data.killed_num >= pve_data.refreshed_mon)
)
) {
game_over_ = true; game_over_ = true;
game_over_frameno_ = GetFrameNo(); game_over_frameno_ = GetFrameNo();
OnGameOver(); OnGameOver();