transfered from codeberg
This commit is contained in:
23
source_code/item_module/item/item.c
Normal file
23
source_code/item_module/item/item.c
Normal file
@@ -0,0 +1,23 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user