This commit is contained in:
aozhiwei 2024-05-14 17:00:14 +08:00
parent 55ed1af4b6
commit c038e93e75

View File

@ -1285,9 +1285,12 @@ void Room::TraverseAliveHumanList(std::function<bool (Human*)> func)
void Room::TraverseCreatureList(std::function<bool (Creature*)> func) void Room::TraverseCreatureList(std::function<bool (Creature*)> func)
{ {
for (auto& pair : moveable_hash_) { for (auto& pair : moveable_hash_) {
if (pair.second && !pair.second->IsOb() && pair.second->IsCreature(this)) { if (pair.second && pair.second->IsCreature(this)) {
if (!func((Creature*)pair.second)) { Creature* c = (Creature*)pair.second;
break; if (!c->IsOb()) {
if (!func(c)) {
break;
}
} }
} }
} }