Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Fix] Changing Group Leader Invalidated GetLeaderName() #3712

Merged
merged 1 commit into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions zone/groups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2510,3 +2510,9 @@ 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);
}
4 changes: 3 additions & 1 deletion zone/groups.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Group : public GroupIDConsumer {
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 membername[0]; };
const char* GetLeaderName() { return GetGroupLeaderName(GetID()).c_str(); };
void SendHPManaEndPacketsTo(Mob* newmember);
void SendHPPacketsFrom(Mob* member);
void SendManaPacketFrom(Mob* member);
Expand Down Expand Up @@ -177,6 +177,8 @@ class Group : public GroupIDConsumer {
int mentor_percent;

XTargetAutoHaters m_autohatermgr;

std::string GetGroupLeaderName(uint32 group_id);
};

#endif