Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
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
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
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
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, Google

Members: 0
Guests: 5
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Bugfix Lists » SWFOTE FUSS Bugfix List » [Bug] Contents in containers ...
Forum Rules | Mark all | Recent Posts

[Bug] Contents in containers do not reset properly or at all
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Dec 26, 2005, 10:24 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Bug: Contents in containers do not reset properly or at all
Danger: Medium - Many items inside containers will disappear from circulation needlessly.
Found by: Zeno
Fixed by: Samson

---

reset.c

Locate function get_obj_type, and under it, add the following new function:
/* Find an object in a room so we can check it's dependents. Used by 'O' resets. */
OBJ_DATA *get_obj_room( OBJ_INDEX_DATA *pObjIndex, ROOM_INDEX_DATA *pRoomIndex )
{
   OBJ_DATA *obj;

   for( obj = pRoomIndex->first_content; obj; obj = obj->next_content )
   {
      if( obj->pIndexData == pObjIndex )
         return obj;
   }
   return NULL;
}


Locate the reset_room function and find:
            if( count_obj_list( pReset, pObjIndex, pRoomIndex->first_content ) > 0 )
            {
               obj = NULL;
               lastobj = NULL;
               break;
            }

            obj = create_object( pObjIndex, number_fuzzy( generate_itemlevel( room->area, pObjIndex ) ) );
            if( num > 1 )
               pObjIndex->count += ( num - 1 );
            obj->count = pReset->arg2;
            obj->level = UMIN( obj->level, LEVEL_AVATAR );
            obj->cost = 0;
            obj_to_room( obj, pRoomIndex );
            for( n = 0; n < MAX_NEST; n++ )
               nestmap[n] = NULL;
            nestmap[0] = obj;
            lastobj = nestmap[0];
            lastnest = 0;


Replace that with:
            if( count_obj_list( pReset, pObjIndex, pRoomIndex->first_content ) < 1 )
            {
               obj = create_object( pObjIndex, number_fuzzy( generate_itemlevel( room->area, pObjIndex ) ) );
               if( num > 1 )
                  pObjIndex->count += ( num - 1 );
               obj->count = pReset->arg2;
               obj->level = UMIN( obj->level, LEVEL_AVATAR );
               obj->cost = 0;
               obj_to_room( obj, pRoomIndex );
            }
            else
            {
               int x;

               if( !( obj = get_obj_room( pObjIndex, pRoomIndex ) ) )
               {
                  obj = NULL;
                  lastobj = NULL;
                  break;
               }
               obj->extra_flags = pObjIndex->extra_flags;
               for( x = 0; x < 6; ++x )
                  obj->value[x] = pObjIndex->value[x];
            }
            for( n = 0; n < MAX_NEST; n++ )
               nestmap[n] = NULL;
            nestmap[0] = obj;
            lastobj = nestmap[0];
            lastnest = 0;


The problem here was that container items and their contents would reset normally after first reboot/crash/whatever. Then as time goes by and players come get these contents, the reset system was not triggering to refill the containers. Since the container itself is not often removed unless it's small enough the item is already present and the reset is skipped. But since put resets depend on their parent object resets, the refill is also skipped. This should no longer be a problem.

It is also not necessary to treat mobs in the same manner. If a mob is still present, there should be no reason to reset him. Even if some of his items or gold are pinched by thieves, logic should prevail and he should only reset if killed. And if he's dead, he doesn't exist, so the system will fire off his resets properly anyway.
       
Pages:<< prev 1 next >>