Skip to content

Commit

Permalink
fix: fluid type must be within enum (opentibiabr#1678)
Browse files Browse the repository at this point in the history
Whenever auction is ended, resulting fluid type should be between 0 and
the size of fluid type enum.
  • Loading branch information
un000000 authored Oct 10, 2023
1 parent e133007 commit c8f7233
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/items/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Item::Item(const uint16_t itemId, uint16_t itemCount /*= 0*/) :
const ItemType &it = items[id];
auto itemCharges = it.charges;
if (it.isFluidContainer() || it.isSplash()) {
setAttribute(ItemAttribute_t::FLUIDTYPE, itemCount);
setAttribute(ItemAttribute_t::FLUIDTYPE, itemCount * (itemCount < sizeof(Fluids_t)));
} else if (it.stackable) {
if (itemCount != 0) {
setItemCount(static_cast<uint8_t>(itemCount));
Expand Down

0 comments on commit c8f7233

Please sign in to comment.