forked from EXTERNAL/bareiron
don't give players items when their inventory is full
This commit is contained in:
@@ -239,7 +239,8 @@ int givePlayerItem (PlayerData *player, uint16_t item, uint8_t count) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (slot == 255) return 1;
|
// Fail to assign item if slot is outside of main inventory
|
||||||
|
if (slot >= 36) return 1;
|
||||||
|
|
||||||
player->inventory_items[slot] = item;
|
player->inventory_items[slot] = item;
|
||||||
player->inventory_count[slot] += count;
|
player->inventory_count[slot] += count;
|
||||||
|
Reference in New Issue
Block a user