mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 17:54:01 +00:00
Breakout rest of the enums from dCommonVars and clean it up (#1061)
* Breakout rest of the enums from dcommonvars so we don't have to deal with merge conflicts ePlayerFlags is not a scoped enum, yet, due to it's complexity * address feedback * make player flag types consistent * fix typo
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include "Loot.h"
|
||||
#include "eObjectBits.h"
|
||||
#include "eReplicaComponentType.h"
|
||||
#include "eUseItemResponse.h"
|
||||
|
||||
#include "CDBrickIDTableTable.h"
|
||||
#include "CDObjectSkillsTable.h"
|
||||
@@ -330,7 +331,7 @@ void Item::UseNonEquip(Item* item) {
|
||||
}
|
||||
}
|
||||
if (playerInventoryComponent->HasSpaceForLoot(rolledLoot)) {
|
||||
LootGenerator::Instance().GiveLoot(playerInventoryComponent->GetParent(), rolledLoot, eLootSourceType::LOOT_SOURCE_CONSUMPTION);
|
||||
LootGenerator::Instance().GiveLoot(playerInventoryComponent->GetParent(), rolledLoot, eLootSourceType::CONSUMPTION);
|
||||
item->SetCount(item->GetCount() - 1);
|
||||
} else {
|
||||
success = false;
|
||||
@@ -339,7 +340,7 @@ void Item::UseNonEquip(Item* item) {
|
||||
GameMessages::SendUseItemRequirementsResponse(
|
||||
playerInventoryComponent->GetParent()->GetObjectID(),
|
||||
playerInventoryComponent->GetParent()->GetSystemAddress(),
|
||||
UseItemResponse::FailedPrecondition
|
||||
eUseItemResponse::FailedPrecondition
|
||||
);
|
||||
success = false;
|
||||
}
|
||||
@@ -379,7 +380,7 @@ void Item::Disassemble(const eInventoryType inventoryType) {
|
||||
}
|
||||
|
||||
for (const auto mod : modArray) {
|
||||
inventory->GetComponent()->AddItem(mod, 1, eLootSourceType::LOOT_SOURCE_DELETION, inventoryType);
|
||||
inventory->GetComponent()->AddItem(mod, 1, eLootSourceType::DELETION, inventoryType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -477,7 +478,7 @@ void Item::DisassembleModel() {
|
||||
continue;
|
||||
}
|
||||
|
||||
GetInventory()->GetComponent()->AddItem(brickID[0].NDObjectID, 1, eLootSourceType::LOOT_SOURCE_DELETION);
|
||||
GetInventory()->GetComponent()->AddItem(brickID[0].NDObjectID, 1, eLootSourceType::DELETION);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#include "dLogger.h"
|
||||
#include "Preconditions.h"
|
||||
#include "eInventoryType.h"
|
||||
#include "eLootSourceType.h"
|
||||
|
||||
/**
|
||||
* An item that can be stored in an inventory and optionally consumed or equipped
|
||||
@@ -38,7 +39,7 @@ public:
|
||||
const std::vector<LDFBaseData*>& config,
|
||||
LWOOBJID parent,
|
||||
LWOOBJID subKey,
|
||||
eLootSourceType lootSourceType = eLootSourceType::LOOT_SOURCE_NONE
|
||||
eLootSourceType lootSourceType = eLootSourceType::NONE
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -65,7 +66,7 @@ public:
|
||||
bool isModMoveAndEquip = false,
|
||||
LWOOBJID subKey = LWOOBJID_EMPTY,
|
||||
bool bound = false,
|
||||
eLootSourceType lootSourceType = eLootSourceType::LOOT_SOURCE_NONE
|
||||
eLootSourceType lootSourceType = eLootSourceType::NONE
|
||||
);
|
||||
|
||||
~Item();
|
||||
@@ -89,7 +90,7 @@ public:
|
||||
* @param disassemble if items were removed, this returns all the sub parts of the item individually if it had assembly part lots
|
||||
* @param showFlyingLoot shows flying loot to the client, if not silent
|
||||
*/
|
||||
void SetCount(uint32_t value, bool silent = false, bool disassemble = true, bool showFlyingLoot = true, eLootSourceType lootSourceType = eLootSourceType::LOOT_SOURCE_NONE);
|
||||
void SetCount(uint32_t value, bool silent = false, bool disassemble = true, bool showFlyingLoot = true, eLootSourceType lootSourceType = eLootSourceType::NONE);
|
||||
|
||||
/**
|
||||
* Returns the number of items this item represents (e.g. for stacks)
|
||||
|
Reference in New Issue
Block a user