Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 Couple bugs
Yesterday, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
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
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!, DotBot

Members: 0
Guests: 14
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » Rare items snippet bug
Forum Rules | Mark all | Recent Posts

Rare items snippet bug
< Newer Topic :: Older Topic > Purging / mppurge can lead to wrong

Pages:<< prev 1 next >>
* #1 Apr 24, 2005, 2:29 pm
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts367
JoinedMar 7, 2005

Found this earlier, forgot to post about it.

Apparently if you purge a mob that has rare eq on it, it'll improperly preserve the item counts as if it was a player being extract_char'ed with rare eq on them. I imagine the same would happen with mppurge. The end result is that if you purge a mob with rare eq and then reset the area, he won't repop with new eq because the limit wasn't adjusted downward when he (and his eq) was run through extract_char.

There's a simple fix though, at least one that seems to work for me:

handler.c (note this is with rent snippet installed, doesn't apply to stock code)

    xREMOVE_BIT( ch->act, ACT_MOUNTED );

    while ( (obj = ch->last_carrying) != NULL )
    {
      if ( obj->pIndexData->rent >= MIN_RENT )
	    obj->pIndexData->count += obj->count;
	extract_obj(obj);
    }

    char_from_room(ch);


I changed it to this:

    xREMOVE_BIT( ch->act, ACT_MOUNTED );

    while ( (obj = ch->last_carrying) != NULL )
    {
      if ( !IS_NPC(ch) && obj->pIndexData->rent >= MIN_RENT )
	    obj->pIndexData->count += obj->count;
	extract_obj(obj);
    }

    char_from_room(ch);


Seems that this works fine. If an npc is being extracted with rare eq on it, there was no corpse generated and since the item is going bye bye with the npc, it shouldn't preserve the count the way it does when a PC leaves with rare eq.

Does anyone see any problems with this fix? Please comment if you do, I would appreciate the input.

Thanks! B)
       
Pages:<< prev 1 next >>