diff --git a/src/c/character.c b/src/c/character.c index 7bc246b..141be76 100644 --- a/src/c/character.c +++ b/src/c/character.c @@ -247,6 +247,13 @@ char* getItemName (Item *item) { return item->name; } +void initializeInventory (Character *character) { + for (int i = 0; i < 10; i++) + { + character->inventory[i] = NULL; + } +} + void putItemInInventory (Character *character, Item *item,int inventorySlot) { if(inventorySlot > 9) { printf("Inventory slot is out of range (0-9)\n"); diff --git a/src/c/character.h b/src/c/character.h index 4ff39f2..c47f8f6 100644 --- a/src/c/character.h +++ b/src/c/character.h @@ -123,4 +123,5 @@ char* getItemName (Item *item); void putItemInInventory (Character *character, Item *item, int inventorySlot); +void initializeInventory (Character *character); #endif \ No newline at end of file