This commit is contained in:
aozhiwei 2024-02-02 16:24:27 +08:00
parent f3042168a4
commit a7423a63e9

View File

@ -2085,12 +2085,16 @@ void Room::RandRemoveAndroid()
{ {
Human* hum = nullptr; Human* hum = nullptr;
if (!hum) { if (!hum) {
for (auto& pair : human_hash_) { TraverseHumanList
if (pair.second->IsAndroid() && pair.second->team_uuid.empty()) { (
hum = pair.second; [&hum] (Human* ele_hum) -> bool
break; {
} if (ele_hum->IsAndroid() && ele_hum->team_uuid.empty()) {
} hum = ele_hum;
return false;
}
return true;
});
} }
if (hum) { if (hum) {
if (hum->team_id != 0) { if (hum->team_id != 0) {