Jump to content

[mangos 0.12][Fix Patch][update guild_rank DB]


Guest mns
 Share

Recommended Posts

Mangos 923e00df031cfbe3b97e40292fe1f7a433f56dcf

Bug : When player update Guild Rank then update rankId+1

I think this Bug Related to 106e4c4b90508e20d3e0a2f07c97ab6fabb650da

diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp
index 4246bb7..7520a5d 100644
--- a/src/game/Guild.cpp
+++ b/src/game/Guild.cpp
@@ -681,7 +681,7 @@ void Guild::SetRankName(uint32 rankId, std::string name_)

    // name now can be used for encoding to DB
    CharacterDatabase.escape_string(name_);
-    CharacterDatabase.PExecute("UPDATE guild_rank SET rname='%s' WHERE rid='%u' AND guildid='%u'", name_.c_str(), (rankId+1), m_Id);
+    CharacterDatabase.PExecute("UPDATE guild_rank SET rname='%s' WHERE rid='%u' AND guildid='%u'", name_.c_str(), rankId, m_Id);
}

void Guild::SetRankRights(uint32 rankId, uint32 rights)
@@ -691,7 +691,7 @@ void Guild::SetRankRights(uint32 rankId, uint32 rights)

    m_Ranks[rankId].Rights = rights;

-    CharacterDatabase.PExecute("UPDATE guild_rank SET rights='%u' WHERE rid='%u' AND guildid='%u'", rights, (rankId+1), m_Id);
+    CharacterDatabase.PExecute("UPDATE guild_rank SET rights='%u' WHERE rid='%u' AND guildid='%u'", rights, rankId, m_Id);
}

int32 Guild::GetRank(uint32 LowGuid)
@@ -1406,7 +1406,7 @@ void Guild::SetBankMoneyPerDay(uint32 rankId, uint32 money)
        if (itr->second.RankId == rankId)
            itr->second.BankResetTimeMoney = 0;

-    CharacterDatabase.PExecute("UPDATE guild_rank SET BankMoneyPerDay='%u' WHERE rid='%u' AND guildid='%u'", money, (rankId+1), m_Id);
+    CharacterDatabase.PExecute("UPDATE guild_rank SET BankMoneyPerDay='%u' WHERE rid='%u' AND guildid='%u'", money, rankId, m_Id);
    CharacterDatabase.PExecute("UPDATE guild_member SET BankResetTimeMoney='0' WHERE guildid='%u' AND rank='%u'", m_Id, rankId);
}

Link to comment
Share on other sites

Thanks for pointing to problem. Patch similar suggested by you has been applied as hotfix ( [8464] ) to master also in time apply related backported patches but not catched as need t backporting . Now [8464] also backported.

Thx for researching :)

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use