Jump to content

[8464] Guild ranks - Bug


Guest nvbk
 Share

Recommended Posts

You should check your database for

CREATE TABLE `guild_rank` (
 `guildid` int(6) unsigned NOT NULL default '0',
 `rid` int(11) unsigned NOT NULL,
 `rname` varchar(255) NOT NULL default '',
 `rights` int(3) unsigned NOT NULL default '0',
 `BankMoneyPerDay` int(11) unsigned NOT NULL default '0',
 PRIMARY KEY  (`guildid`,`rid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Guild System';

There is no way to have 2 ranks with same rank_ids (`rid`) for one guild.

Or you use some old patch, that breaks function of guild ranks.

If you delete that table, all guilds will be disbanned, so you have to update its structure!

Link to comment
Share on other sites

Confirmed.

added: I thing problem here:

Patch fix it

diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp
index 41e9adb..52b38f0 100644
--- a/src/game/Guild.cpp
+++ b/src/game/Guild.cpp
@@ -680,7 +680,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)
@@ -690,7 +690,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)
@@ -1402,7 +1402,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);
}

I'll test it.

Added:

Now working fine ))

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