implement actual items dropping
This commit is contained in:
@@ -12,6 +12,9 @@ ItemStack::ItemStack(itemid_t item, itemcount_t count) : item(item), count(count
|
||||
void ItemStack::set(const ItemStack& item) {
|
||||
this->item = item.item;
|
||||
this->count = item.count;
|
||||
if (count == 0) {
|
||||
this->item = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool ItemStack::accepts(const ItemStack& other) const {
|
||||
|
||||
@@ -32,7 +32,7 @@ static std::shared_ptr<Inventory> get_inventory(int64_t id, int arg) {
|
||||
}
|
||||
|
||||
static void validate_slotid(int slotid, Inventory* inv) {
|
||||
if (slotid < 0 || uint64_t(slotid) >= inv->size()) {
|
||||
if (static_cast<size_t>(slotid) >= inv->size()) {
|
||||
throw std::runtime_error("slot index is out of range [0..inventory.size(invid)]");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user