Beispiel #1
0
    //take an item out of the pack
    public static THING leave_pack(THING obj, bool newobj, bool all)
    {
        THING nobj;

        inpack--;
        nobj = obj;
        if (obj.Count > 1 && !all)
        {
            obj.Count--;
            if (obj.o_group != 0)
            {
                inpack++;
            }

            if (newobj)
            {
                nobj        = obj.Copy();
                nobj.l_next = null;
                nobj.l_prev = null;
                nobj.Count  = 1;
            }
        }
        else
        {
            //FIXME      instead of marking a slot unused, just delete item from a dynamic pack list
            THING myPack = Agent.Plyr.Pack;
            detach(ref myPack, obj);
            Agent.Plyr.Pack = myPack;
        }
        return(nobj);
    }
Beispiel #2
0
    // take an item out of the pack
    THING leave_pack(THING obj, bool newobj, bool all)
    {
        THING nobj;

        inpack--;
        nobj = obj;
        if (obj.o_count > 1 && !all)
        {
            last_pick = obj;
            obj.o_count--;
            if (obj.o_group != 0)
            {
                inpack++;
            }
            if (newobj)
            {
                nobj         = obj.Copy();
                nobj.l_next  = null;
                nobj.l_prev  = null;
                nobj.o_count = 1;
            }
        }
        else
        {
            last_pick = null;
            pack_used[obj.o_packch - 'a'] = false;
            THING myPack = pack;
            detach(ref myPack, obj);
            pack = myPack;
        }
        return(nobj);
    }