24 lines
812 B
C
24 lines
812 B
C
#include "item.h"
|
|
|
|
#include <string.h>
|
|
|
|
/**
|
|
* Initializes an item structure with specific properties.
|
|
* This function is used to populate item data from the global item registry
|
|
* into specific instances (like inventory slots or world drops).
|
|
*/
|
|
void initialize_item(item_struct *item,
|
|
uint32_t new_item_id,
|
|
uint16_t new_max_durability,
|
|
uint8_t new_max_stack,
|
|
item_type_struct new_item_type,
|
|
bool new_is_placeable)
|
|
{
|
|
memset(item, 0, sizeof(item_struct));
|
|
item->item_id = new_item_id;
|
|
item->max_durability = new_max_durability;
|
|
item->max_stack = new_max_stack;
|
|
item->item_type = new_item_type;
|
|
item->is_placeable = new_is_placeable;
|
|
}
|