Skip to content

Commit

Permalink
{EQEmu PR 3712} [Bug Fix] Changing Group Leader Invalidated GetLeader…
Browse files Browse the repository at this point in the history
…Name()

# Notes
- Utilizes fixes posted in EQEmu/Server#3706 to resolve EQEmu/Server#368.
- Changing group leader caused issues because we assumed `member[0]` was always leader.
  • Loading branch information
fryguy503 committed Dec 1, 2023
1 parent d601869 commit 275c513
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions zone/groups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2385,3 +2385,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, bool share = false);
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

0 comments on commit 275c513

Please sign in to comment.