1
This commit is contained in:
parent
d955bfe830
commit
3e8450060e
@ -2453,7 +2453,7 @@ int Room::InitWithMobaBattle(long ip_saddr, int socket_handle, std::shared_ptr<c
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
//int side = a8::RandEx(1, 2);
|
//int side = a8::RandEx(1, 2);
|
||||||
int side = 2;
|
int side = 1;
|
||||||
for (size_t i = 0; i < 2; ++i) {
|
for (size_t i = 0; i < 2; ++i) {
|
||||||
auto team = room_teams.at(i);
|
auto team = room_teams.at(i);
|
||||||
if (team->GetMemberNum() < MAX_TEAM_NUM) {
|
if (team->GetMemberNum() < MAX_TEAM_NUM) {
|
||||||
|
@ -2346,21 +2346,6 @@ void Room::DecBornPointHumanNum(std::shared_ptr<BornPoint> point, Human* hum)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Room::SecondRandPoint()
|
|
||||||
{
|
|
||||||
#ifdef MYDEBUG
|
|
||||||
CheckPartObjects();
|
|
||||||
#endif
|
|
||||||
for (auto& pair : accountid_hash_) {
|
|
||||||
Human* hum = pair.second;
|
|
||||||
hum->SetBornPoint(AllocBornPoint(hum));
|
|
||||||
}
|
|
||||||
CombineTeamBornPoint();
|
|
||||||
#ifdef MYDEBUG
|
|
||||||
CheckPartObjects();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void Room::NotifyGameStart()
|
void Room::NotifyGameStart()
|
||||||
{
|
{
|
||||||
cs::SMGameStart msg;
|
cs::SMGameStart msg;
|
||||||
@ -2642,13 +2627,6 @@ void Room::RemoveFromLaterAddHash(RoomEntity* entity)
|
|||||||
later_add_hash_.erase(entity->GetUniId());
|
later_add_hash_.erase(entity->GetUniId());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Room::CombineTeamBornPoint()
|
|
||||||
{
|
|
||||||
for (auto& pair : team_hash_) {
|
|
||||||
pair.second->CombineBornPoint();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Room::ForceSetBornPoint(Human* hum, std::shared_ptr<BornPoint> born_point)
|
void Room::ForceSetBornPoint(Human* hum, std::shared_ptr<BornPoint> born_point)
|
||||||
{
|
{
|
||||||
if (born_point && hum->GetBornPoint() != born_point) {
|
if (born_point && hum->GetBornPoint() != born_point) {
|
||||||
|
@ -313,7 +313,6 @@ private:
|
|||||||
void CreateWorldObjects();
|
void CreateWorldObjects();
|
||||||
void IncBornPointHumanNum(std::shared_ptr<BornPoint> point, Human* hum);
|
void IncBornPointHumanNum(std::shared_ptr<BornPoint> point, Human* hum);
|
||||||
void DecBornPointHumanNum(std::shared_ptr<BornPoint> point, Human* hum);
|
void DecBornPointHumanNum(std::shared_ptr<BornPoint> point, Human* hum);
|
||||||
void SecondRandPoint();
|
|
||||||
void NotifyGameStart();
|
void NotifyGameStart();
|
||||||
void EnableHuman(Human* hum);
|
void EnableHuman(Human* hum);
|
||||||
void DisableHuman(Human* hum);
|
void DisableHuman(Human* hum);
|
||||||
@ -333,7 +332,6 @@ private:
|
|||||||
void RemoveFromLaterAddHash(RoomEntity* entity);
|
void RemoveFromLaterAddHash(RoomEntity* entity);
|
||||||
|
|
||||||
void AddPlayerPostProc(Player* hum);
|
void AddPlayerPostProc(Player* hum);
|
||||||
void CombineTeamBornPoint();
|
|
||||||
void ForceSetBornPoint(Human* hum, std::shared_ptr<BornPoint> born_point);
|
void ForceSetBornPoint(Human* hum, std::shared_ptr<BornPoint> born_point);
|
||||||
std::shared_ptr<BornPoint> ForceTakeBornPoint(Human* hum, std::shared_ptr<BornPoint> reserve_born_point);
|
std::shared_ptr<BornPoint> ForceTakeBornPoint(Human* hum, std::shared_ptr<BornPoint> reserve_born_point);
|
||||||
void NewBieRoomStart();
|
void NewBieRoomStart();
|
||||||
|
@ -107,38 +107,6 @@ bool Team::IsFull()
|
|||||||
return GetMemberNum() >= room->GetMaxTeamNum();
|
return GetMemberNum() >= room->GetMaxTeamNum();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Team::CombineBornPoint()
|
|
||||||
{
|
|
||||||
Human* target = nullptr;
|
|
||||||
for (Human* member : members_) {
|
|
||||||
if (!target) {
|
|
||||||
target = member;
|
|
||||||
} else {
|
|
||||||
if (target->GetBornPoint()) {
|
|
||||||
if (member->GetBornPoint()) {
|
|
||||||
room->DecBornPointHumanNum(member->GetBornPoint(), member);
|
|
||||||
}
|
|
||||||
member->SetBornPoint(target->GetBornPoint());
|
|
||||||
if (member->GetBornPoint()) {
|
|
||||||
room->IncBornPointHumanNum(member->GetBornPoint(), member);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} //end if
|
|
||||||
if (!member->GetBornPoint()) {
|
|
||||||
abort();
|
|
||||||
} else {
|
|
||||||
member->SetPos(member->GetBornPoint()->RandPoint(member->room));
|
|
||||||
}
|
|
||||||
if (!a8::HasBitFlag(member->status, CS_Disable)) {
|
|
||||||
member->FindLocation();
|
|
||||||
member->RefreshView();
|
|
||||||
room->grid_service->MoveCreature(member);
|
|
||||||
} else {
|
|
||||||
room->EnableHuman(member);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int Team::GetAliveNum()
|
int Team::GetAliveNum()
|
||||||
{
|
{
|
||||||
int num = 0;
|
int num = 0;
|
||||||
|
@ -40,7 +40,6 @@ class Team
|
|||||||
void AddMember(Human* member);
|
void AddMember(Human* member);
|
||||||
void RemoveMember(Human* member);
|
void RemoveMember(Human* member);
|
||||||
bool IsFull();
|
bool IsFull();
|
||||||
void CombineBornPoint();
|
|
||||||
void CombineTeam(Team* b_team);
|
void CombineTeam(Team* b_team);
|
||||||
bool CanCombine(Human* member);
|
bool CanCombine(Human* member);
|
||||||
void AddCombineMemberNum(int member_num);
|
void AddCombineMemberNum(int member_num);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user