This commit is contained in:
aozhiwei 2020-07-31 20:30:37 +08:00
parent f41cce27fc
commit 9ca06774e9

View File

@ -1233,9 +1233,29 @@ bool Human::HasLiveTeammate()
bool Human::HasNoDownedTeammate()
{
if (room->GetRoomMode() == kZombieMode &&
GetRace() == kHumanRace) {
return true;
if (room->GetRoomMode() == kZombieMode) {
if (GetRace() == kHumanRace) {
bool has_now_downed_teammate = false;
Human* myself = this;
room->TouchHumanList
(
a8::XParams(),
[myself, &has_now_downed_teammate] (Human* hum, const a8::XParams& param)
{
if (myself != hum &&
!hum->dead &&
!hum->downed &&
hum->GetRace() == kHumanRace) {
has_now_downed_teammate = true;
return false;
}
return true;
}
);
return has_now_downed_teammate;
} else {
return false;
}
}
if (team_members) {
for (auto& hum : *team_members) {