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:
David Markowitz
2022-12-18 07:46:04 -08:00
committed by GitHub
parent b972acbacc
commit 84c5d74450
26 changed files with 130 additions and 27 deletions

View File

@@ -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;