1
This commit is contained in:
parent
f747efb205
commit
59c2c8ccb1
@ -1040,6 +1040,9 @@ void Bullet::ProcRequestBulletDmg(int shield_hit, int strength_wall_uniid, int t
|
||||
if (room->OverBorder(GetPos().ToGlmVec3(), gun_meta->bullet_rad())) {
|
||||
return;
|
||||
}
|
||||
if (!sender.Get()) {
|
||||
return;
|
||||
}
|
||||
|
||||
GetMutablePos().FromGlmVec3(pos);
|
||||
room->grid_service->MoveBullet(this);
|
||||
|
@ -1511,20 +1511,22 @@ void Room::CombineTeam()
|
||||
int total_count = 0;
|
||||
for (auto& pair : team_hash_) {
|
||||
Team* team = pair.second;
|
||||
team->TraverseMembers
|
||||
(
|
||||
[this, team, &first_team_id, &total_count, &need_combine_teams] (Human* member) -> bool
|
||||
{
|
||||
if (member->auto_fill && !member->team_uuid.empty()) {
|
||||
if (first_team_id == 0) {
|
||||
first_team_id = team->GetTeamId();
|
||||
if (!team->AllIsRunAway()) {
|
||||
team->TraverseMembers
|
||||
(
|
||||
[this, team, &first_team_id, &total_count, &need_combine_teams] (Human* member) -> bool
|
||||
{
|
||||
if (member->auto_fill && !member->team_uuid.empty()) {
|
||||
if (first_team_id == 0) {
|
||||
first_team_id = team->GetTeamId();
|
||||
}
|
||||
need_combine_teams[team->GetTeamId()] = team->GetMemberNum();
|
||||
total_count += team->GetMemberNum();
|
||||
return false;
|
||||
}
|
||||
need_combine_teams[team->GetTeamId()] = team->GetMemberNum();
|
||||
total_count += team->GetMemberNum();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (total_count <= 1) {
|
||||
|
@ -213,6 +213,9 @@ void Team::SendTeamBattleReport(Human* sender)
|
||||
if (!player) {
|
||||
return;
|
||||
}
|
||||
if (AllIsRunAway()) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::shared_ptr<a8::MutableXObject> post_data = a8::MutableXObject::CreateObject();
|
||||
GenBattleReportData(player, post_data.get());
|
||||
@ -466,3 +469,13 @@ void Team::RunAway(Human* hum)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool Team::AllIsRunAway()
|
||||
{
|
||||
for (Human* hum : members_) {
|
||||
if (!hum->stats->is_run_away) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -50,6 +50,7 @@ class Team
|
||||
void GenBattleReportData(Human* player, a8::MutableXObject* params);
|
||||
void GenBattleUuid();
|
||||
void RunAway(Human* hum);
|
||||
bool AllIsRunAway();
|
||||
|
||||
private:
|
||||
int team_id_ = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user