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

View File

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