修复队友全死后不发GameOver问题

This commit is contained in:
aozhiwei 2024-08-21 10:30:07 +08:00
parent 30d33f97ab
commit f0fb944f7e
3 changed files with 23 additions and 1 deletions

View File

@ -252,6 +252,21 @@ void Player::_CMExecCommand(f8::MsgHdr* hdr, const cs::CMExecCommand& msg)
room->grid_service->MoveCreature(hum);
return true;
});
} else if (cmd == "dead_teammate") {
GetTeam()->TraverseMembers
(
[this] (Human* hum) -> bool
{
if (hum != this && !hum->dead) {
hum->BeKill(VP_Gas,
TEXT("battle_server_killer_gas", "毒圈"),
VW_Gas,
VP_Gas,
TEXT("battle_server_killer_gas", "毒圈"));
return false;
}
return true;
});
} else if (cmd == "total_lucky") {
SendDebugMsg(a8::Format("total_lucky:%f", {GetNetData()->GetTotalLucky()}));
} else if (cmd == "randomobj" && cmds.size() >= 2) {

View File

@ -1281,6 +1281,9 @@ void Human::OnDie()
return true;
});
}
if (IsPlayer()) {
int i = 0;
}
if (real_dead) {
std::set<Human*> over_humans;
if (!leave_) {

View File

@ -1539,6 +1539,9 @@ void Human::SendUpdateMsg()
void Human::SendGameOver()
{
if (IsPlayer()){
int i = 0;
}
CalcStats();
if (stats->abandon_battle == 1 || (GetTeam()->HasPlayer()) || GetTeam()->MemberHasOb()) {
if (room->IsAlreadyRoomReportBattle()) {
@ -1565,7 +1568,8 @@ void Human::SendGameOver()
sent_personal_report_ = true;
}
if (GetTeam()->team_rank && GetTeam()->HasPlayer() && !GetTeam()->IsViewTeam() &&
stats->abandon_battle != 1 && !room->IsMobaModeRoom()) {
stats->abandon_battle != 1 && !room->IsMobaModeRoom() &&
!GetTeam()->IsAlreadyReportBattle()) {
GetTeam()->TrySendTeamBattleReport(this);
} else {
cs::SMGameOver msg;