Check item type in source

bWolfie

I'm the man
Messages
850
Points
0
Location
Alberta, Midgard
Github
bWolfie
Emulator
Hello,

I'm trying to make a plugin which will automatically store an item by type. I'm testing at the moment with IT_ETC but I can't get it to work.

How to correctly check item type?
Thanks

Code:
struct item_data* id;
for (i = 0; i < MAX_INVENTORY; i++)
{
	id = 0;
	if (sd->status.inventory[i].amount)
	{
		id = itemdb_type(sd->status.inventory[i].nameid);
		if (id && id->type == IT_ETC)
			storage->add(sd, i, sd->status.inventory[i].amount);
	}
}
 
Code:
sd->inventory_data[i].type
 
Back
Top