1
0
mirror of https://github.com/p2r3/bareiron.git synced 2025-10-01 23:25:09 +02:00

don't give players items when their inventory is full

This commit is contained in:
p2r3
2025-08-30 00:44:02 +03:00
parent ee63b7c7f4
commit a1ef1c52d2

View File

@@ -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_count[slot] += count;