Re: Extracting a certain number of objects from a char

"Valnir" <[email protected]> Wed, 8 Mar 2006 14:53:41 -0500
Newsgroups gmane.games.devel.mud.rom
Message-ID <[email protected]>
First off, you don't have packs defined as a number, therefor packs will 
typically default to ZERO. So 6*packs is still ZERO.

- Valnir

P.S. If anyone gets on me about my reply style, you can shove it up your 
butt. Your "formatted" reply style is hard as hell to read.

----- Original Message ----- 
From: <[email protected]>
To: <[email protected]>
Sent: Wednesday, March 08, 2006 2:39 PM
Subject: Extracting a certain number of objects from a char


> 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
> 

-- 
ROM mailing list
[email protected]
Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom