mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-30 17:58:16 +00:00
[Bug Fix] Fix GetLeaderName() for Groups (#4184)
* [Bug Fix] Fix GetLeaderName() for Groups # Notes - We were getting bogus data in this. - Made it its own method. * Remove ExpeditionRequest::GetGroupLeaderName()
This commit is contained in:
+1
-1
@@ -2152,7 +2152,7 @@ Group *EntityList::GetGroupByLeaderName(const char *leader)
|
||||
iterator = group_list.begin();
|
||||
|
||||
while (iterator != group_list.end()) {
|
||||
if (!strcmp((*iterator)->GetLeaderName(), leader))
|
||||
if (!strcmp((*iterator)->GetLeaderName().c_str(), leader))
|
||||
return *iterator;
|
||||
++iterator;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ bool ExpeditionRequest::CanGroupRequest(Group* group)
|
||||
}
|
||||
|
||||
// Group::GetLeaderName() is broken if group formed across zones, ask database instead
|
||||
m_leader_name = m_leader ? m_leader->GetName() : GetGroupLeaderName(group->GetID()); // group->GetLeaderName();
|
||||
m_leader_name = m_leader ? m_leader->GetName() : group->GetLeaderName();
|
||||
m_leader_id = m_leader ? m_leader->CharacterID() : database.GetCharacterID(m_leader_name);
|
||||
|
||||
std::vector<std::string> member_names;
|
||||
@@ -148,13 +148,6 @@ bool ExpeditionRequest::CanGroupRequest(Group* group)
|
||||
return CanMembersJoin(member_names);
|
||||
}
|
||||
|
||||
std::string ExpeditionRequest::GetGroupLeaderName(uint32_t group_id)
|
||||
{
|
||||
char leader_name_buffer[64] = { 0 };
|
||||
database.GetGroupLeadershipInfo(group_id, leader_name_buffer);
|
||||
return std::string(leader_name_buffer);
|
||||
}
|
||||
|
||||
bool ExpeditionRequest::CanMembersJoin(const std::vector<std::string>& member_names)
|
||||
{
|
||||
if (member_names.empty())
|
||||
|
||||
@@ -54,7 +54,6 @@ private:
|
||||
bool CanRaidRequest(Raid* raid);
|
||||
bool CanGroupRequest(Group* group);
|
||||
bool CheckMembersForConflicts(const std::vector<std::string>& member_names);
|
||||
std::string GetGroupLeaderName(uint32_t group_id);
|
||||
bool IsPlayerCountValidated();
|
||||
bool SaveLeaderLockouts(const std::vector<ExpeditionLockoutTimer>& leader_lockouts);
|
||||
void SendLeaderMemberInExpedition(const std::string& member_name, bool is_solo);
|
||||
|
||||
+7
-9
@@ -620,7 +620,7 @@ bool Group::DelMemberOOZ(const char *Name) {
|
||||
if(!strcasecmp(Name, membername[i]))
|
||||
// This shouldn't be called if the member is in this zone.
|
||||
if(!members[i]) {
|
||||
if(!strncmp(GetLeaderName(), Name, 64))
|
||||
if(!strncmp(GetLeaderName().c_str(), Name, 64))
|
||||
{
|
||||
//TODO: Transfer leadership if leader disbands OOZ.
|
||||
UpdateGroupAAs();
|
||||
@@ -703,7 +703,7 @@ bool Group::DelMember(Mob* oldmember, bool ignoresender)
|
||||
}
|
||||
}
|
||||
|
||||
if (!GetLeaderName())
|
||||
if (GetLeaderName().empty())
|
||||
{
|
||||
DisbandGroup();
|
||||
return true;
|
||||
@@ -1676,7 +1676,7 @@ void Group::NotifyMainTank(Client *c, uint8 toggle)
|
||||
|
||||
strn0cpy(grs->Name1, MainTankName.c_str(), sizeof(grs->Name1));
|
||||
|
||||
strn0cpy(grs->Name2, GetLeaderName(), sizeof(grs->Name2));
|
||||
strn0cpy(grs->Name2, GetLeaderName().c_str(), sizeof(grs->Name2));
|
||||
|
||||
grs->RoleNumber = 1;
|
||||
|
||||
@@ -1729,7 +1729,7 @@ void Group::NotifyMainAssist(Client *c, uint8 toggle)
|
||||
|
||||
strn0cpy(grs->Name1, MainAssistName.c_str(), sizeof(grs->Name1));
|
||||
|
||||
strn0cpy(grs->Name2, GetLeaderName(), sizeof(grs->Name2));
|
||||
strn0cpy(grs->Name2, GetLeaderName().c_str(), sizeof(grs->Name2));
|
||||
|
||||
grs->RoleNumber = 2;
|
||||
|
||||
@@ -1771,7 +1771,7 @@ void Group::NotifyPuller(Client *c, uint8 toggle)
|
||||
|
||||
strn0cpy(grs->Name1, PullerName.c_str(), sizeof(grs->Name1));
|
||||
|
||||
strn0cpy(grs->Name2, GetLeaderName(), sizeof(grs->Name2));
|
||||
strn0cpy(grs->Name2, GetLeaderName().c_str(), sizeof(grs->Name2));
|
||||
|
||||
grs->RoleNumber = 3;
|
||||
|
||||
@@ -2511,8 +2511,6 @@ bool Group::IsLeader(const char* name) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string Group::GetGroupLeaderName(uint32 group_id) {
|
||||
char leader_name_buffer[64] = { 0 };
|
||||
database.GetGroupLeadershipInfo(group_id, leader_name_buffer);
|
||||
return std::string(leader_name_buffer);
|
||||
std::string Group::GetLeaderName() {
|
||||
return database.GetGroupLeaderName(GetID());
|
||||
}
|
||||
|
||||
+1
-3
@@ -76,7 +76,7 @@ public:
|
||||
void SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, Client *splitter = nullptr);
|
||||
inline void SetLeader(Mob* c){ leader = c; };
|
||||
inline Mob* GetLeader() { return leader; };
|
||||
const char* GetLeaderName() { return GetGroupLeaderName(GetID()).c_str(); };
|
||||
std::string GetLeaderName();
|
||||
void SendHPManaEndPacketsTo(Mob* newmember);
|
||||
void SendHPPacketsFrom(Mob* member);
|
||||
void SendManaPacketFrom(Mob* member);
|
||||
@@ -177,8 +177,6 @@ private:
|
||||
int mentor_percent;
|
||||
|
||||
XTargetAutoHaters m_autohatermgr;
|
||||
|
||||
std::string GetGroupLeaderName(uint32 group_id);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ Lua_Mob Lua_Group::GetLeader() {
|
||||
return self->GetLeader();
|
||||
}
|
||||
|
||||
const char *Lua_Group::GetLeaderName() {
|
||||
std::string Lua_Group::GetLeaderName() {
|
||||
Lua_Safe_Call_String();
|
||||
return self->GetLeaderName();
|
||||
}
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ public:
|
||||
void SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, Lua_Client splitter);
|
||||
void SetLeader(Lua_Mob c);
|
||||
Lua_Mob GetLeader();
|
||||
const char *GetLeaderName();
|
||||
std::string GetLeaderName();
|
||||
bool IsLeader(const char* name);
|
||||
bool IsLeader(Lua_Mob c);
|
||||
int GroupCount();
|
||||
|
||||
Reference in New Issue
Block a user