diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 0a6bcc4f..56c04d1d 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -963,10 +963,11 @@ void Human::FillSMGameOver(cs::SMGameOver& msg) if (room->IsPveRoom()) { } else { stats.victory = stats.rank == 1; + if (GetTeam()->GetAliveNum() <= 0) { + GetTeam()->team_rank = room->GetAliveTeamNum(); + } if (stats.victory) { - stats.team_rank = 1; - } else { - stats.team_rank = room->GetAliveTeamNum(); + GetTeam()->team_rank = 1; } } } @@ -974,7 +975,6 @@ void Human::FillSMGameOver(cs::SMGameOver& msg) if (stats.pve_kill_boss) { stats.victory = true; } - } else { } if (stats.victory) { @@ -992,7 +992,7 @@ void Human::FillSMGameOver(cs::SMGameOver& msg) } msg.set_map_id(room->GetMapMeta()->i->map_id()); msg.set_team_id(team_id); - msg.set_team_rank(stats.team_rank); + msg.set_team_rank(GetTeam()->team_rank); msg.set_personal_rank(stats.rank); if (room->IsPveRoom()) { msg.set_game_over(room->IsGameOver()); diff --git a/server/gameserver/human.h b/server/gameserver/human.h index 62e9fd7c..2e46158c 100644 --- a/server/gameserver/human.h +++ b/server/gameserver/human.h @@ -98,7 +98,6 @@ struct PlayerStats int weapon_id = 0; int rank = 0; - int team_rank = 0; int skill_times = 0; bool victory = false;