1
This commit is contained in:
parent
ff1dc417d8
commit
b9530e1319
@ -2085,7 +2085,13 @@ void Room::RandRemoveAndroid()
|
||||
}
|
||||
if (hum) {
|
||||
if (hum->team_id != 0) {
|
||||
team_hash_.erase(hum->team_id);
|
||||
Team* team = GetTeam(hum->team_id);
|
||||
if (team) {
|
||||
team->RemoveMember(hum);
|
||||
if (team->GetMemberNum() < 1) {
|
||||
team_hash_.erase(hum->team_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hum->born_point) {
|
||||
DecBornPointHumanNum(hum->born_point, hum);
|
||||
@ -2102,6 +2108,9 @@ void Room::RandRemoveAndroid()
|
||||
for (auto& pair : human_hash_) {
|
||||
pair.second->RemovePartObjects(hum);
|
||||
}
|
||||
for (auto& pair : human_hash_) {
|
||||
pair.second->RemoveObjects(hum);
|
||||
}
|
||||
frame_event.AddExitGame(hum->GetWeakPtrRef());
|
||||
}
|
||||
}
|
||||
|
@ -566,3 +566,12 @@ int Team::GetPlayerNum()
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
void Team::RemoveMember(Human* member)
|
||||
{
|
||||
members_.erase(member);
|
||||
first_member_ = nullptr;
|
||||
for (auto hum : members_) {
|
||||
first_member_ = hum;
|
||||
}
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ class Team
|
||||
int GetAliveNum();
|
||||
int GetAlivePlayerNum();
|
||||
void AddMember(Human* member);
|
||||
void RemoveMember(Human* member);
|
||||
bool IsFull();
|
||||
void CombineBornPoint();
|
||||
void CombineTeam(Team* b_team);
|
||||
|
@ -181,7 +181,7 @@ behaviac::EBTStatus AndroidAgent::CoJoin()
|
||||
msg.set_auto_fill(1);
|
||||
msg.set_name("");
|
||||
msg.set_avatar_url("");
|
||||
msg.set_mapid(2007);
|
||||
msg.set_mapid(2002);
|
||||
msg.set_hero_id(30800);
|
||||
//weapons
|
||||
msg.set_session_id(owner_->GetSessionId());
|
||||
|
Loading…
x
Reference in New Issue
Block a user