Tristan Haynes wrote: > > I'm currently writing some new code to implement a better fireweapon/missile code <<snip>> > That is the code that handles loading the ammo into the gun, next is the code for unloading. > > weapon = get_obj_in_list_vis(ch, arg, NULL, ch->carrying); > ammo = weapon->next; > obj_from_obj(ammo); > obj_to_char(ammo, ch); Greetings, In the future, you might attempt reading the exact code you're attempting to copy. In act.item.c, in get_from_container(): if (!(obj = get_obj_in_list_vis(ch, arg, NULL, cont->contains))) In short, change ammo = weapon->next; to ammo = weapon->contains; Worth noting, from what you've shown, one can load multiple items into a weapon and unload will only remove the first item from the weapon. You might also look at Crash_save(). I don't have the time to fully investigate, but I think it may well dump all of the weapons' contents into a player's inventory when he logs back in. -- +---------------------------------------------------------------+ | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html | | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html | | Newbie List: http://groups.yahoo.com/group/circle-newbies/ | +---------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 06/25/03 PDT