From 674173034b539f225c120aa659072b463ffa273f Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 10 Sep 2021 03:28:57 +0000 Subject: [PATCH] 1 --- server/gameserver/human.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index b721553c..20faa03f 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -597,6 +597,7 @@ void Human::FindPathInMapService() void Human::FillSMGameOver(cs::SMGameOver& msg) { + int alive_team_num = room->GetAliveTeamNum(); if (stats.rank <= 0) { std::vector human_list; room->TraverseHumanList(a8::XParams(), @@ -635,7 +636,7 @@ void Human::FillSMGameOver(cs::SMGameOver& msg) break; } } - if (room->GetAliveTeamNum() == 1) { + if (alive_team_num == 1) { if (room->GetAliveTeam() == GetTeam()) { rank = 1; } @@ -644,14 +645,14 @@ void Human::FillSMGameOver(cs::SMGameOver& msg) } if (MetaMgr::Instance()->watchable) { - msg.set_watchable(dead); + msg.set_watchable(dead || (alive_team_num == 1)); } else { msg.set_watchable(false); } msg.set_team_id(team_id); msg.set_team_rank(stats.rank); msg.set_team_allcnt(1); - msg.set_game_over(room->IsGameOver()); + msg.set_game_over(room->IsGameOver() || (alive_team_num == 1)); msg.set_victory(!dead); msg.set_room_uuid(a8::XValue(room->GetRoomUuid())); msg.set_total_human_num(room->GetHumanNum());