mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 17:54:01 +00:00
added lootsource send in GM
WIP commit
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
class Inventory;
|
||||
|
||||
|
||||
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)
|
||||
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))
|
||||
{
|
||||
@@ -46,7 +46,8 @@ Item::Item(
|
||||
bool showFlyingLoot,
|
||||
bool isModMoveAndEquip,
|
||||
LWOOBJID subKey,
|
||||
bool bound)
|
||||
bool bound,
|
||||
eLootSourceType lootSourceType)
|
||||
{
|
||||
if (!Inventory::IsValidItem(lot))
|
||||
{
|
||||
@@ -80,8 +81,8 @@ Item::Item(
|
||||
inventory->AddManagedItem(this);
|
||||
|
||||
auto* entity = inventory->GetComponent()->GetParent();
|
||||
|
||||
GameMessages::SendAddItemToInventoryClientSync(entity, entity->GetSystemAddress(), this, id, showFlyingLoot, static_cast<int>(this->count), subKey);
|
||||
Game::logger->Log("test", "source %i\n", lootSourceType);
|
||||
GameMessages::SendAddItemToInventoryClientSync(entity, entity->GetSystemAddress(), this, id, showFlyingLoot, static_cast<int>(this->count), subKey, lootSourceType);
|
||||
|
||||
if (isModMoveAndEquip)
|
||||
{
|
||||
@@ -176,7 +177,7 @@ void Item::SetCount(const uint32_t value, const bool silent, const bool disassem
|
||||
|
||||
if (value > count)
|
||||
{
|
||||
GameMessages::SendAddItemToInventoryClientSync(entity, entity->GetSystemAddress(), this, id, showFlyingLoot, delta);
|
||||
GameMessages::SendAddItemToInventoryClientSync(entity, entity->GetSystemAddress(), this, id, showFlyingLoot, delta, 0LL);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -374,7 +375,7 @@ void Item::Disassemble(const eInventoryType inventoryType)
|
||||
|
||||
for (const auto mod : modArray)
|
||||
{
|
||||
inventory->GetComponent()->AddItem(mod, 1, inventoryType);
|
||||
inventory->GetComponent()->AddItem(mod, 1, inventoryType, {}, 0LL, true, false, 0LL, eInventoryType::INVALID, 0, false, -1, eLootSourceType::LOOT_SOURCE_DELETION);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -472,7 +473,7 @@ void Item::DisassembleModel()
|
||||
continue;
|
||||
}
|
||||
|
||||
GetInventory()->GetComponent()->AddItem(brickID[0].NDObjectID, 1);
|
||||
GetInventory()->GetComponent()->AddItem(brickID[0].NDObjectID, 1, eInventoryType::INVALID, {}, 0LL, true, false, 0LL, eInventoryType::INVALID, 0, false, -1, eLootSourceType::LOOT_SOURCE_DELETION);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -36,7 +36,8 @@ public:
|
||||
bool bound,
|
||||
const std::vector<LDFBaseData*>& config,
|
||||
LWOOBJID parent,
|
||||
LWOOBJID subKey
|
||||
LWOOBJID subKey,
|
||||
eLootSourceType lootSourceType = eLootSourceType::LOOT_SOURCE_NONE
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -62,7 +63,8 @@ public:
|
||||
bool showFlyingLoot = true,
|
||||
bool isModMoveAndEquip = false,
|
||||
LWOOBJID subKey = LWOOBJID_EMPTY,
|
||||
bool bound = false
|
||||
bool bound = false,
|
||||
eLootSourceType lootSourceType = eLootSourceType::LOOT_SOURCE_NONE
|
||||
);
|
||||
|
||||
~Item();
|
||||
|
Reference in New Issue
Block a user