mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
(RoF+) Added a work-around for the cursor buffer issue.
This commit is contained in:
+13
-2
@@ -89,6 +89,17 @@ ItemInst* ItemInstQueue::pop()
|
||||
return inst;
|
||||
}
|
||||
|
||||
// Remove item from back of queue
|
||||
ItemInst* ItemInstQueue::pop_back()
|
||||
{
|
||||
if (m_list.size() == 0)
|
||||
return nullptr;
|
||||
|
||||
ItemInst* inst = m_list.back();
|
||||
m_list.pop_back();
|
||||
return inst;
|
||||
}
|
||||
|
||||
// Look at item at front of queue
|
||||
ItemInst* ItemInstQueue::peek_front() const
|
||||
{
|
||||
@@ -259,9 +270,9 @@ int16 Inventory::PushCursor(const ItemInst& inst)
|
||||
return MainCursor;
|
||||
}
|
||||
|
||||
ItemInst* Inventory::PopCursor()
|
||||
ItemInst* Inventory::GetCursorItem()
|
||||
{
|
||||
return m_cursor.pop();
|
||||
return m_cursor.peek_front();
|
||||
}
|
||||
|
||||
// Swap items in inventory
|
||||
|
||||
+4
-2
@@ -93,6 +93,7 @@ public:
|
||||
void push(ItemInst* inst);
|
||||
void push_front(ItemInst* inst);
|
||||
ItemInst* pop();
|
||||
ItemInst* pop_back();
|
||||
ItemInst* peek_front() const;
|
||||
inline int size() { return static_cast<int>(m_list.size()); }
|
||||
|
||||
@@ -151,8 +152,9 @@ public:
|
||||
|
||||
// Add item to cursor queue
|
||||
int16 PushCursor(const ItemInst& inst);
|
||||
// Remove item from cursor queue
|
||||
ItemInst* PopCursor();
|
||||
|
||||
// Get cursor item in front of queue
|
||||
ItemInst* GetCursorItem();
|
||||
|
||||
// Swap items in inventory
|
||||
bool SwapItem(int16 slot_a, int16 slot_b);
|
||||
|
||||
Reference in New Issue
Block a user