Extracting a certain number of objects from a char
[email protected] Wed, 08 Mar 2006 19:39:15 +0000
| Newsgroups | gmane.games.devel.mud.rom |
|---|---|
| Message-ID | <030820061939.11055.440F32E30009B92A00002B2F22070215539D01040E089B@comcast.net> |
Greetings list,
How would you (in code) extract a certain number of the same object (vnum) from a character.
Here is what I tried and it didnt seem to work. Any help would be appreciated.
OBJ_DATA *food;
OBJ_DATA *pack;
OBJ_DATA *food_next;
int count=2;
int packs;
for (x = 0; x < count; x++)
{
obj = create_object( get_obj_index( 41 ), 0 );
obj_to_char( obj, ch );
for (y = packs*6; y > 0; y--)
{
for ( food = ch->carrying; food != NULL; food = obj_next )
{
food_next = food->next_content;
obj_from_char(food);
extract_obj(food);
continue;
}
}
}
Example.
Say I have 6 items and want to combine them into 1.....
6 food items into 1 food pack.
Thanks for any insight!
-K
--
ROM mailing list
[email protected]
Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom