mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-12-12 02:58:32 +00:00
fix: saving gm invis for non gms (#1940)
This commit is contained in:
@@ -31,7 +31,7 @@ public:
|
||||
std::string& GetSessionKey() { return m_SessionKey; }
|
||||
SystemAddress& GetSystemAddress() { return m_SystemAddress; }
|
||||
|
||||
eGameMasterLevel GetMaxGMLevel() { return m_MaxGMLevel; }
|
||||
eGameMasterLevel GetMaxGMLevel() const { return m_MaxGMLevel; }
|
||||
uint32_t GetLastCharID() { return m_LastCharID; }
|
||||
void SetLastCharID(uint32_t newCharID) { m_LastCharID = newCharID; }
|
||||
|
||||
|
||||
@@ -43,7 +43,8 @@ void GhostComponent::UpdateXml(tinyxml2::XMLDocument& doc) {
|
||||
auto* ghstElement = objElement->FirstChildElement("ghst");
|
||||
if (ghstElement) objElement->DeleteChild(ghstElement);
|
||||
// Only save if GM invisible
|
||||
if (!m_IsGMInvisible) return;
|
||||
const auto* const user = UserManager::Instance()->GetUser(m_Parent->GetSystemAddress());
|
||||
if (!m_IsGMInvisible || !user || user->GetMaxGMLevel() < eGameMasterLevel::FORUM_MODERATOR) return;
|
||||
ghstElement = objElement->InsertNewChildElement("ghst");
|
||||
if (ghstElement) ghstElement->SetAttribute("i", m_IsGMInvisible);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user