Hi all, what im needing to do is check through a players inventory to see of they have X amount of an object in there,
The way it was done in the smippet i have is as follows,
The trouble with doing it this way is that once the first object is extracted it fails to find find the next corpse in inventory and always fails, could someone show me a better way to achieve the same outcome, or is there an existing function that i can use that will check how many of an object there are in a players inventory.
Thanks in advance.
The way it was done in the smippet i have is as follows,
for (x = 0; x <= mnum; x++)
{
material = get_obj_carry (ch, "corpse" );
if (material == NULL)
{
send_to_char( "You didn't realize it when you started, but you haven't enough material\n\r", ch);
return;
}
extract_obj( material );
}
The trouble with doing it this way is that once the first object is extracted it fails to find find the next corpse in inventory and always fails, could someone show me a better way to achieve the same outcome, or is there an existing function that i can use that will check how many of an object there are in a players inventory.
Thanks in advance.