File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -167,12 +167,9 @@ bool GuildBankAction::AutoWithdraw(GameObject* bank)
167167
168168 for (uint8 slotId = 0 ; slotId < GUILD_BANK_MAX_SLOTS; ++slotId)
169169 {
170- #ifdef MANGOSBOT_TWO
171- GuildAccess* guildAccess = reinterpret_cast <GuildAccess*>(guild);
172- Item* item = guildAccess->GetItem (tabId, slotId);
173- #else
174- Item* item = guild->GetItem (tabId, slotId);
175- #endif
170+ GuildAccess* guildAccess = static_cast <GuildAccess*>(guild);
171+ Item* item = guildAccess->GetGuildItem (tabId, slotId);
172+
176173 if (!item)
177174 continue ;
178175
Original file line number Diff line number Diff line change @@ -197,12 +197,9 @@ bool ShouldGuildBankWithdrawValue::Calculate()
197197
198198 for (uint8 slotId = 0 ; slotId < GUILD_BANK_MAX_SLOTS; ++slotId)
199199 {
200- #ifdef MANGOSBOT_TWO
201- GuildAccess* guildAccess = reinterpret_cast <GuildAccess*>(guild);
202- Item* item = guildAccess->GetItem (tabId, slotId);
203- #else
204- Item* item = guild->GetItem (tabId, slotId);
205- #endif
200+ GuildAccess* guildAccess = static_cast <GuildAccess*>(guild);
201+ Item* item = guildAccess->GetGuildItem (tabId, slotId);
202+
206203 if (!item)
207204 continue ;
208205
Original file line number Diff line number Diff line change 1010
1111using namespace ai ;
1212
13- #ifdef MANGOSBOT_TWO
14- Item* GuildAccess::GetItem (uint8 TabId, uint8 SlotId)
13+ #ifndef MANGOSBOT_ZERO
14+ Item* GuildAccess::GetGuildItem (uint8 TabId, uint8 SlotId)
1515{
1616 if (TabId >= GetPurchasedTabs () || SlotId >= GUILD_BANK_MAX_SLOTS)
1717 return nullptr ;
Original file line number Diff line number Diff line change 44
55namespace ai
66{
7- #ifdef MANGOSBOT_TWO
8- // Accessor class to reach private Guild methods (mirrors LootAccess pattern)
9- class GuildAccess
7+ #ifndef MANGOSBOT_ZERO
8+ class GuildAccess : public Guild
109 {
1110 public:
12- uint8 GetPurchasedTabs () const { return m_TabList.size (); }
13- Item* GetItem (uint8 TabId, uint8 SlotId);
14- private:
15- typedef std::unordered_map<uint32, MemberSlot> MemberList;
16- typedef std::vector<RankInfo> RankList;
17- uint32 m_Id;
18- std::string m_Name;
19- ObjectGuid m_LeaderGuid;
20- std::string MOTD;
21- std::string GINFO;
22- time_t m_CreatedDate;
23-
24- uint32 m_EmblemStyle;
25- uint32 m_EmblemColor;
26- uint32 m_BorderStyle;
27- uint32 m_BorderColor;
28- uint32 m_BackgroundColor;
29- uint32 m_accountsNumber; // 0 used as marker for need lazy calculation at request
30-
31- RankList m_Ranks;
32-
33- MemberList members;
34-
35- std::vector<GuildBankTab> m_TabList;
36-
37- /* * These are actually ordered lists. The first element is the oldest entry.*/
38- typedef std::list<GuildEventLogEntry> GuildEventLog;
39- typedef std::list<GuildBankEventLogEntry> GuildBankEventLog;
40- GuildEventLog m_GuildEventLog;
41- GuildBankEventLog m_GuildBankEventLog_Money;
42- GuildBankEventLog m_GuildBankEventLog_Item[GUILD_BANK_MAX_TABS];
43-
44- uint32 m_GuildEventLogNextGuid;
45- uint32 m_GuildBankEventLogNextGuid_Money;
46- uint32 m_GuildBankEventLogNextGuid_Item[GUILD_BANK_MAX_TABS];
47-
48- uint64 m_GuildBankMoney;
49-
50- MaNGOS::unique_weak_ptr<Guild> m_weakRef;
11+ Item* GetGuildItem (uint8 TabId, uint8 SlotId);
5112 };
5213#endif
5314
You can’t perform that action at this time.
0 commit comments