mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
Add Delete Inventory Slash Command (#865)
* moving branch
* Add deleteinven slash command
* Change name of BRICKS_IN_BBB
* Use string_view instead of strcmp
* Remove GameConfig
* Revert "Remove GameConfig"
This reverts commit cef5cdeea2
.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "GameMessages.h"
|
||||
#include "Game.h"
|
||||
#include "Item.h"
|
||||
#include "InventoryComponent.h"
|
||||
#include "eItemType.h"
|
||||
|
||||
std::vector<LOT> Inventory::m_GameMasterRestrictedItems = {
|
||||
@@ -266,7 +267,7 @@ eInventoryType Inventory::FindInventoryTypeForLot(const LOT lot) {
|
||||
case eItemType::ITEM_TYPE_QUEST_OBJECT:
|
||||
case eItemType::ITEM_TYPE_UNKNOWN:
|
||||
default:
|
||||
return HIDDEN;
|
||||
return QUEST;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,6 +301,12 @@ const std::vector<LOT>& Inventory::GetAllGMItems() {
|
||||
return m_GameMasterRestrictedItems;
|
||||
}
|
||||
|
||||
void Inventory::DeleteAllItems() {
|
||||
while (!this->items.empty()) {
|
||||
if (items.begin()->second) items.begin()->second->SetCount(0);
|
||||
}
|
||||
}
|
||||
|
||||
Inventory::~Inventory() {
|
||||
for (auto item : items) {
|
||||
delete item.second;
|
||||
|
@@ -10,6 +10,7 @@
|
||||
#include "CDClientManager.h"
|
||||
#include "dCommonVars.h"
|
||||
|
||||
enum eInventoryType : uint32_t;
|
||||
class Item;
|
||||
class InventoryComponent;
|
||||
|
||||
@@ -152,6 +153,11 @@ public:
|
||||
*/
|
||||
static const std::vector<LOT>& GetAllGMItems();
|
||||
|
||||
/**
|
||||
* Remove ALL Items from this inventory.
|
||||
*/
|
||||
void DeleteAllItems();
|
||||
|
||||
~Inventory();
|
||||
|
||||
private:
|
||||
|
@@ -14,9 +14,7 @@
|
||||
#include "CharacterComponent.h"
|
||||
#include "eItemType.h"
|
||||
#include "AssetManager.h"
|
||||
|
||||
class Inventory;
|
||||
|
||||
#include "InventoryComponent.h"
|
||||
|
||||
Item::Item(const LWOOBJID id, const LOT lot, Inventory* inventory, const uint32_t slot, const uint32_t count, const bool bound, const std::vector<LDFBaseData*>& config, const LWOOBJID parent, LWOOBJID subKey, eLootSourceType lootSourceType) {
|
||||
if (!Inventory::IsValidItem(lot)) {
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#include "CDClientManager.h"
|
||||
#include "dLogger.h"
|
||||
#include "Preconditions.h"
|
||||
#include "eInventoryType.h"
|
||||
|
||||
/**
|
||||
* An item that can be stored in an inventory and optionally consumed or equipped
|
||||
|
Reference in New Issue
Block a user