1
This commit is contained in:
parent
cdebb91c27
commit
7b6de450fb
@ -231,7 +231,7 @@ Player* Room::NewPlayer()
|
||||
return hum;
|
||||
}
|
||||
|
||||
void Room::AddPlayer(Player* hum)
|
||||
void Room::AddPlayer(Player* hum, BornPoint* init_born_point, bool no_matchteam)
|
||||
{
|
||||
if (gas_data_.gas_mode != GasInactive) {
|
||||
abort();
|
||||
@ -239,7 +239,11 @@ void Room::AddPlayer(Player* hum)
|
||||
while (human_hash_.size() >= GetRoomMaxPlayerNum()) {
|
||||
RandRemoveAndroid();
|
||||
}
|
||||
if (init_born_point) {
|
||||
hum->born_point = init_born_point;
|
||||
} else {
|
||||
hum->born_point = AllocBornPoint(hum);
|
||||
}
|
||||
if (!hum->born_point) {
|
||||
hum->SetPos(GetDefaultBornPoint());
|
||||
} else {
|
||||
@ -259,7 +263,9 @@ void Room::AddPlayer(Player* hum)
|
||||
AddToAccountHash(hum);
|
||||
AddToHumanHash(hum);
|
||||
AddToAliveHumanHash(hum);
|
||||
if (!no_matchteam) {
|
||||
MatchTeam(hum);
|
||||
}
|
||||
hum->PushJoinRoomMsg();
|
||||
++alive_count_;
|
||||
alive_count_chged_frameno_ = GetFrameNo();
|
||||
@ -1805,7 +1811,7 @@ void Room::RandRemoveAndroid()
|
||||
}
|
||||
if (!hum) {
|
||||
for (auto& pair : human_hash_) {
|
||||
if (pair.second->IsAndroid()) {
|
||||
if (pair.second->IsAndroid() && pair.second->team_uuid.empty()) {
|
||||
hum = pair.second;
|
||||
break;
|
||||
}
|
||||
@ -3877,6 +3883,7 @@ void Room::AddTeam(class MatchTeam* team)
|
||||
if (team->GetCurrMembers().size() != MAX_TEAM_NUM) {
|
||||
return;
|
||||
}
|
||||
BornPoint* init_born_point = nullptr;
|
||||
for (auto& member : team->GetCurrMembers()) {
|
||||
cs::CMJoin& msg = member->msg;
|
||||
if (member->is_robot) {
|
||||
@ -3885,7 +3892,10 @@ void Room::AddTeam(class MatchTeam* team)
|
||||
hum->name = robot_meta->i->name();
|
||||
hum->meta = MetaMgr::Instance()->GetPlayer(robot_meta->i->hero_id());
|
||||
hum->robot_meta = robot_meta;
|
||||
hum->born_point = AllocBornPoint(hum);
|
||||
if (!init_born_point) {
|
||||
init_born_point = AllocBornPoint(hum);
|
||||
}
|
||||
hum->born_point = init_born_point;
|
||||
if (!hum->born_point) {
|
||||
hum->SetPos(GetDefaultBornPoint());
|
||||
} else {
|
||||
@ -3900,7 +3910,9 @@ void Room::AddTeam(class MatchTeam* team)
|
||||
hum->Initialize();
|
||||
AddToEntityHash(hum);
|
||||
AddToHumanHash(hum);
|
||||
#if 0
|
||||
MatchTeam(hum);
|
||||
#endif
|
||||
++alive_count_;
|
||||
alive_count_chged_frameno_ = GetFrameNo();
|
||||
++PerfMonitor::Instance()->alive_count;
|
||||
|
@ -125,7 +125,7 @@ public:
|
||||
int GetRealPlayerNum() { return accountid_hash_.size();}
|
||||
|
||||
Player* NewPlayer();
|
||||
void AddPlayer(Player* hum);
|
||||
void AddPlayer(Player* hum, BornPoint* init_born_point = nullptr, bool no_matchteam = false);
|
||||
Human* FindEnemy(Human* hum);
|
||||
|
||||
void AddTeam(class MatchTeam* team);
|
||||
|
Loading…
x
Reference in New Issue
Block a user