fix(game): delete beaten monsters so ambushes start fights

This commit is contained in:
capyb2222 committed 2026-09-12 22:05:15 -07:00
1 parent 38880e4976
commit 201f1bb07f
3 files changed
+38 -2

No files matched your search

+18
View File
@@ -402,6 +402,24 @@ void runFlowTests() {
check(resultRsp.battle_id == result.battle_id, "battle id echoed");
check(resultRsp.end_status == proto::BattleEndStatus::BATTLE_END_WIN,
"end status echoed");
// LOADED here throws in the client and leaves the monster standing.
// Earlier refreshes (the lineup edit's) are still queued, so skip to
// the one that deletes.
bool deleted = false;
net::Packet refreshPacket;
while (!deleted && client.await(cmd::SceneGroupRefreshScNotify, refreshPacket, 500)) {
proto::SceneGroupRefreshScNotify refresh;
if (!parseBody(refreshPacket, refresh)) break;
for (const proto::GroupRefreshInfo& group : refresh.group_refresh_list) {
for (const proto::SceneEntityRefreshInfo& change : group.refresh_entity) {
if (change.delete_entity != monsters[0]) continue;
deleted = group.refresh_type ==
proto::SceneGroupRefreshType::SCENE_GROUP_REFRESH_TYPE_AFIBFMAFNCC;
}
}
}
check(deleted, "the beaten monster is deleted the way the client accepts");
}
}