OBJ_DATA *object;
OBJ_DATA *missile = NULL;
OBJ_DATA *missile_next = NULL;
//Some code for validating 'object' exists.
if (object->item_type != ITEM_MISSILE && container->item_type == ITEM_QUIVER)
{
send_to_char ("That's not a missile.\r\n",ch);
return;
}
for (missile = container->contains; missile != NULL; missile = missile_next)
{
missile_next = missile->next_content;
//it found something in the container and it's also a missile… may be a redundant check on the second part.
if (missile && missile->item_type == ITEM_MISSILE)
{
if (missile->missile_type != object->missile_type)
{
send_to_char ("It must be the same type of missile.\r\n",ch);
return;
}
else
{
//Throw it in the bag ;)
return;
}
break;
}
}
if (container->item_type == ITEM_QUIVER)
if (IS_SET(container, ITEM_QUIVER))
I've added my quiver and missile item types.. and I've modified do_put so that you can only put missiles into quivers… but the last thing I want it to do is make it so only the -same- type of missiles will be able to go into a quiver..
This is my do_put() thus far:
I'm not sure how to write it.. but it needs to do something like…
look in the quiver..
if no items don't worry
otherwise.. if the first item in the container isn't the same as the one I'm trying to put in… fail..
if it is the same.. continue..
Also.. I'm not sure how on earth I will add all this to the "/* 'put all container' or 'put all.obj container' */" section.
Any help?
Thanks,
Bob.