This commit is contained in:
aozhiwei 2023-04-08 17:37:53 +08:00
parent f747efb205
commit 59c2c8ccb1
4 changed files with 32 additions and 13 deletions

View File

@ -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);

View File

@ -1511,6 +1511,7 @@ void Room::CombineTeam()
int total_count = 0;
for (auto& pair : team_hash_) {
Team* team = pair.second;
if (!team->AllIsRunAway()) {
team->TraverseMembers
(
[this, team, &first_team_id, &total_count, &need_combine_teams] (Human* member) -> bool
@ -1526,6 +1527,7 @@ void Room::CombineTeam()
return true;
});
}
}
if (total_count <= 1) {
return;

View File

@ -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;
}

View File

@ -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;