修复 毒圈问题

This commit is contained in:
aozhiwei 2022-08-31 15:04:46 +08:00
parent 79533ff90f
commit 1327432502
2 changed files with 24 additions and 7 deletions

View File

@ -258,6 +258,13 @@ void Incubator::OnEnterNewWave(int wave)
if (room->IsGameOver()) { if (room->IsGameOver()) {
return; return;
} }
if (
room->pve_data.refreshed_mon > 0 &&
room->pve_data.mon_num > 0
) {
timeout_ = true;
return;
}
room->pve_data.wave = wave + 1; room->pve_data.wave = wave + 1;
room->OnEnterNewWave(wave + 1); room->OnEnterNewWave(wave + 1);
if (wave < 0) { if (wave < 0) {
@ -266,13 +273,6 @@ void Incubator::OnEnterNewWave(int wave)
if (wave >= room->pve_mode_meta->waves.size()) { if (wave >= room->pve_mode_meta->waves.size()) {
abort(); abort();
} }
if (
room->pve_data.refreshed_mon > 0 &&
room->pve_data.mon_num > 0
) {
timeout_ = true;
return;
}
if (wave + 1 < room->pve_mode_meta->waves.size()) { if (wave + 1 < room->pve_mode_meta->waves.size()) {
SpawnWaveMon(wave + 1); SpawnWaveMon(wave + 1);
} }

View File

@ -51,6 +51,15 @@ void PveData::OnBeKill(Hero* hero)
room->NotifyUiUpdate(); room->NotifyUiUpdate();
} }
#ifdef DEBUG
a8::XPrintf("PveData::OnBeKill wave:%d refreshed_mon:%d killed_num:%d\n",
{
wave,
refreshed_mon,
killed_num
});
#endif
if (refreshed_mon > 0) { if (refreshed_mon > 0) {
if (killed_num >= refreshed_mon) { if (killed_num >= refreshed_mon) {
if (room->IsDestoryRoom()) { if (room->IsDestoryRoom()) {
@ -71,6 +80,14 @@ void PveData::OnBeKill(Hero* hero)
void PveData::FlyDoor(Room* room, a8::Vec2& point, int radius) void PveData::FlyDoor(Room* room, a8::Vec2& point, int radius)
{ {
#ifdef DEBUG
a8::XPrintf("FlyDoor wave:%d refreshed_mon:%d killed_num:%d\n",
{
wave,
refreshed_mon,
killed_num
});
#endif
room->TraverseHumanList room->TraverseHumanList
( (
a8::XParams(), a8::XParams(),