Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Google, Yandex

Members: 0
Guests: 8
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » bug in fix_char
Forum Rules | Mark all | Recent Posts

bug in fix_char
< Newer Topic :: Older Topic > Fix

Pages:<< prev 1 next >>
Post is unread #1 Aug 12, 2004, 7:12 pm   Last edited Nov 18, 2007, 4:31 pm by Samson
Go to the top of the page
Go to the bottom of the page

Greven
Magician
GroupMembers
Posts204
JoinedMar 5, 2005

There seems to be a bug in fix_char that is from SMAUG, originally. It lies in
    ncarry = 0;
   while( ( obj = ch->first_carrying) != NULL )
    {
	carry[ncarry++]  = obj;
	obj_from_char( obj );
    }
that section, and seems to cause issues with jewelry. You need to remove that section and
   for( x = 0; x < ncarry; x++ )
       obj_to_char( carry[x], ch );
Now, this is entirely untested except on SWR, but since this code is the same in AFKmud, SMAUG and SWR, I have to assume that the bug is in all three. If someone can tell me that this is a bad thing to remove, I would really appreciate it, cause I can't see any reason for it all.
       
Post is unread #2 Aug 12, 2004, 11:06 pm   Last edited Nov 18, 2007, 4:31 pm by Samson
Go to the top of the page
Go to the bottom of the page

Greven
Magician
GroupMembers
Posts204
JoinedMar 5, 2005

Well, I did actually find a use for them, but I have made a work around. I beleive the from_ and to_ were there to properly calculate object weight and number of items in your inventory. However, that seems like overkill, so I made the bottom of fix_char look like
        for (aff = ch->first_affect; aff; aff = aff->next)
                affect_modify(ch, aff, TRUE);
        re_equip_char(ch);

        ch->carry_weight = 0;
        ch->carry_number = 0;

  for ( obj = ch->first_carrying; obj; obj = obj->next_content )
  {
        	if (obj->wear_loc == WEAR_NONE)
                ch->carry_number += get_obj_number(obj);
            if (!IS_SET(obj->extra_flags, ITEM_MAGIC))
                ch->carry_weight += get_obj_weight(obj);
  }
}
And it seems to have done the trick.
       
Post is unread #3 Aug 15, 2004, 1:15 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

As noted on Nick's forum, good catch. Will be added to the codebase shortly.
       
Post is unread #4 Aug 15, 2004, 3:01 pm
Go to the top of the page
Go to the bottom of the page

Greven
Magician
GroupMembers
Posts204
JoinedMar 5, 2005

Gracias. Normally I won't double post, but I figured there are probably some avid AFKmud users that don't check Nick's.
       
Pages:<< prev 1 next >>