This commit is contained in:
aozhiwei 2023-03-22 14:24:02 +08:00
parent 76567ddb2f
commit 28844db74d
4 changed files with 19 additions and 2 deletions

View File

@ -3259,6 +3259,7 @@ void Human::CalcStats()
if (stats->pve_kill_boss) {
stats->victory = true;
stats->settlement_color = 1;
GetTeam()->team_rank = 1;
}
} else {
stats->victory = stats->rank == 1;
@ -3296,4 +3297,13 @@ void Human::CalcStats()
}
stats->alive_time = alive_time;
}
if (GetTeam()->team_rank) {
GetTeam()->TraverseMembers
(
[] (Human* hum)
{
hum->CalcStats();
return true;
});
}
}

View File

@ -1396,7 +1396,7 @@ void Human::SendGameOver()
SendNotifyMsg(msg);
} else {
CalcStats();
if (stats->team_statsed) {
if (GetTeam()->team_rank) {
if (!GetTeam()->sending_battlereport) {
GetTeam()->sending_battlereport = true;
GetTeam()->SendTeamBattleReport(this);

View File

@ -58,7 +58,6 @@ class Human;
class PlayerStats
{
public:
bool team_statsed = false;
int kills = 0;
long long last_kill_frameno = 0;
int damage_amount_in = 0;

View File

@ -178,4 +178,12 @@ bool Team::HasPlayer()
void Team::SendTeamBattleReport(Human* sender)
{
already_report_battle = true;
sending_battlereport = false;
TraverseMembers
(
[] (Human* hum)
{
hum->SendGameOver();
return true;
});
}