修复组队结算问题
This commit is contained in:
parent
e15d50950a
commit
8bd922db5b
@ -560,6 +560,7 @@ void Human::ResetAction()
|
|||||||
|
|
||||||
void Human::FillSMGameOver(cs::SMGameOver& msg)
|
void Human::FillSMGameOver(cs::SMGameOver& msg)
|
||||||
{
|
{
|
||||||
|
if (stats.rank <= 0) {
|
||||||
std::vector<Human*> human_list;
|
std::vector<Human*> human_list;
|
||||||
room->TouchHumanList(a8::XParams(),
|
room->TouchHumanList(a8::XParams(),
|
||||||
[&human_list] (Human* hum, a8::XParams& param) -> bool
|
[&human_list] (Human* hum, a8::XParams& param) -> bool
|
||||||
@ -587,12 +588,17 @@ void Human::FillSMGameOver(cs::SMGameOver& msg)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!dead && room->GetAliveTeamNum() == 1) {
|
if (room->GetAliveTeamNum() == 1) {
|
||||||
|
std::set<Human*>* alive_team = room->GetAliveTeam();
|
||||||
|
if (alive_team == team_members) {
|
||||||
rank = 1;
|
rank = 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
stats.rank = rank;
|
||||||
|
}
|
||||||
|
|
||||||
msg.set_team_id(team_id);
|
msg.set_team_id(team_id);
|
||||||
msg.set_team_rank(rank);
|
msg.set_team_rank(stats.rank);
|
||||||
msg.set_team_allcnt(1);
|
msg.set_team_allcnt(1);
|
||||||
msg.set_game_over(room->game_over);
|
msg.set_game_over(room->game_over);
|
||||||
msg.set_victory(!dead);
|
msg.set_victory(!dead);
|
||||||
@ -713,15 +719,15 @@ void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (room->GetAliveTeamNum() == 1) {
|
if (room->GetAliveTeamNum() == 1) {
|
||||||
std::set<Human*>* members = room->GetAliveTeam();
|
std::set<Human*>* alive_team = room->GetAliveTeam();
|
||||||
if (members) {
|
if (team_members != alive_team) {
|
||||||
for (Human* member : *members) {
|
SendGameOver();
|
||||||
|
}
|
||||||
|
if (alive_team) {
|
||||||
|
for (Human* member : *alive_team) {
|
||||||
member->SendGameOver();
|
member->SendGameOver();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (team_members != members) {
|
|
||||||
SendGameOver();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
DeadDrop();
|
DeadDrop();
|
||||||
}
|
}
|
||||||
|
@ -87,6 +87,7 @@ struct PlayerStats
|
|||||||
std::string killer_name;
|
std::string killer_name;
|
||||||
int weapon_id = 0;
|
int weapon_id = 0;
|
||||||
|
|
||||||
|
int rank = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Plane
|
struct Plane
|
||||||
|
Loading…
x
Reference in New Issue
Block a user