fix: bucles cap a ranges algorithms (38 troballes)

This commit is contained in:
2026-05-14 21:36:21 +02:00
parent 0aa9f8fe0a
commit b4d3776239
14 changed files with 110 additions and 169 deletions

View File

@@ -1425,11 +1425,11 @@ auto MapEditor::deleteRoom() -> std::string { // NOLINT(readability-function-co
if (target == "0") {
// Buscar la primera room que no sea esta
for (const auto& r : Resource::Cache::get()->getRooms()) {
if (r.name != deleted_name) {
target = r.name;
break;
}
const auto& rooms = Resource::Cache::get()->getRooms();
auto it = std::ranges::find_if(rooms,
[&deleted_name](const auto& r) { return r.name != deleted_name; });
if (it != rooms.end()) {
target = it->name;
}
}
if (target == "0") { return "Cannot delete: no other room to navigate to"; }