Skip to content

Commit

Permalink
Tweaks: weapon charges should be at minimum 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Akkadius committed Oct 15, 2024
1 parent 568d081 commit 4bdc3cb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
28 changes: 15 additions & 13 deletions zone/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12892,18 +12892,20 @@ bool Client::CheckHandin(
}

// pull hand-in items from the item instances
for (const auto &i: items) {
if (!i) {
continue;
}

h.items.emplace_back(
HandinEntry{
.item_id = std::to_string(i->GetItem()->ID),
.count = static_cast<uint32>(i->GetCharges()),
.item = i
if (!m_handin_started) {
for (const auto &i: items) {
if (!i) {
continue;
}
);

h.items.emplace_back(
HandinEntry{
.item_id = std::to_string(i->GetItem()->ID),
.count = std::max(static_cast<uint16>(i->GetCharges()), static_cast<uint16>(1)),
.item = i
}
);
}
}

// compare hand-in to required, the item_id can be in any slot
Expand Down Expand Up @@ -13028,7 +13030,7 @@ void Client::ReturnHandinItems()
.item_name = i.item->GetItem()->Name,
.augment_ids = i.item->GetAugmentIDs(),
.augment_names = i.item->GetAugmentNames(),
.charges = static_cast<uint16>(i.item->GetCharges())
.charges = std::max(static_cast<uint16>(i.item->GetCharges()), static_cast<uint16>(1))
}
);
}
Expand All @@ -13055,7 +13057,7 @@ void Client::ReturnHandinItems()
.item_name = i.item->GetItem()->Name,
.augment_ids = i.item->GetAugmentIDs(),
.augment_names = i.item->GetAugmentNames(),
.charges = static_cast<uint16>(i.item->GetCharges())
.charges = std::max(static_cast<uint16>(i.item->GetCharges()), static_cast<uint16>(1))
}
);

Expand Down
2 changes: 1 addition & 1 deletion zone/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -1822,7 +1822,7 @@ class Client : public Mob
// NPC Handin
struct HandinEntry {
std::string item_id = "0";
uint32 count = 0;
uint16 count = 0;
const EQ::ItemInstance *item = nullptr;
};

Expand Down

0 comments on commit 4bdc3cb

Please sign in to comment.