mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 18:24:12 +00:00
Split itemType enum into it's own header (#647)
* Split itemType enum into it's own header add mount item type * fix whitespace
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "PropertyManagementComponent.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "dConfig.h"
|
||||
#include "eItemType.h"
|
||||
|
||||
InventoryComponent::InventoryComponent(Entity* parent, tinyxml2::XMLDocument* document) : Component(parent)
|
||||
{
|
||||
@@ -1024,13 +1025,13 @@ void InventoryComponent::EquipItem(Item* item, const bool skipChecks)
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == ITEM_TYPE_LOOT_MODEL || type == ITEM_TYPE_VEHICLE)
|
||||
if (type == eItemType::ITEM_TYPE_LOOT_MODEL || type == eItemType::ITEM_TYPE_VEHICLE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (type != ITEM_TYPE_LOOT_MODEL && type != ITEM_TYPE_MODEL)
|
||||
if (type != eItemType::ITEM_TYPE_LOOT_MODEL && type != eItemType::ITEM_TYPE_MODEL)
|
||||
{
|
||||
if (!item->GetBound() && !item->GetPreconditionExpression()->Check(m_Parent))
|
||||
{
|
||||
@@ -1411,15 +1412,15 @@ void InventoryComponent::RemoveDatabasePet(LWOOBJID id)
|
||||
BehaviorSlot InventoryComponent::FindBehaviorSlot(const eItemType type)
|
||||
{
|
||||
switch (type) {
|
||||
case ITEM_TYPE_HAT:
|
||||
case eItemType::ITEM_TYPE_HAT:
|
||||
return BehaviorSlot::Head;
|
||||
case ITEM_TYPE_NECK:
|
||||
case eItemType::ITEM_TYPE_NECK:
|
||||
return BehaviorSlot::Neck;
|
||||
case ITEM_TYPE_LEFT_HAND:
|
||||
case eItemType::ITEM_TYPE_LEFT_HAND:
|
||||
return BehaviorSlot::Offhand;
|
||||
case ITEM_TYPE_RIGHT_HAND:
|
||||
case eItemType::ITEM_TYPE_RIGHT_HAND:
|
||||
return BehaviorSlot::Primary;
|
||||
case ITEM_TYPE_CONSUMABLE:
|
||||
case eItemType::ITEM_TYPE_CONSUMABLE:
|
||||
return BehaviorSlot::Consumable;
|
||||
default:
|
||||
return BehaviorSlot::Invalid;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#ifndef INVENTORYCOMPONENT_H
|
||||
#define INVENTORYCOMPONENT_H
|
||||
@@ -25,6 +25,8 @@ class ItemSet;
|
||||
|
||||
typedef std::map<std::string, EquippedItem> EquipmentMap;
|
||||
|
||||
enum class eItemType : int32_t;
|
||||
|
||||
/**
|
||||
* Handles the inventory of entity, including the items they possess and have equipped. An entity can have inventories
|
||||
* of different types, each type representing a different group of items, see `eInventoryType` for a list of
|
||||
|
Reference in New Issue
Block a user