Re: [CODE] SSE Guns and Ammo Bug

From: Brian (
Date: 10/18/02

Tristan Haynes wrote:
> I'm currently writing some new code to implement a better fireweapon/missile code
> 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);

        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;
   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: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT