Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Couple bugs
Dec 12, 2017, 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, Yandex, Bing, Yahoo!

Members: 0
Guests: 11
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 » SWR FUSS » Bug in fold_area
Forum Rules | Mark all | Recent Posts

Bug in fold_area
< Newer Topic :: Older Topic > Or major annoyance really

Pages:<< prev 1 next >>
Post is unread #1 Jul 1, 2009, 10:20 pm
Go to the top of the page
Go to the bottom of the page

Banner
Magician
GroupMembers
Posts169
JoinedNov 29, 2005


   fprintf( fpout, "#ROOMS\n" );
   for( vnum = tarea->low_r_vnum; vnum <= tarea->hi_r_vnum; vnum++ )
   {
      if( ( room = get_room_index( vnum ) ) == NULL )
         continue;
      if( install )
      {
         CHAR_DATA *victim, *vnext;
         OBJ_DATA *obj, *obj_next;

         /*
          * remove prototype flag from room
          */
         REMOVE_BIT( room->room_flags, ROOM_PROTOTYPE );
         /*
          * purge room of (prototyped) mobiles
          */
         for( victim = room->first_person; victim; victim = vnext )
         {
            vnext = victim->next_in_room;
            if( IS_NPC( victim ) )
               extract_char( victim, TRUE );
         }
         /*
          * purge room of (prototyped) objects
          */
  /*       for( obj = room->first_content; obj; obj = obj_next )
         {
            obj_next = obj->next_content;
            extract_obj( obj );
         }
  */
      }


Hullo! The problem above is the obj for loop. The theory seems to be that they wanted to purge prototype objects that got stuck in the area by a builder that forgot to remove a flag, except, unless I'm missing something, there is no check for the prototype flag on the object. The mob check is the same, however, none of my mobs were randomly disappearing.

I discovered this problem when a player would design a ship (which would save pships.are), and subsequently every player ship in the game would be purged of any item not in the list of resets, which is essentially every item a player has dropped in his or her ship. Several people have workshops on their ships where they stash items while they make armor and whatnot, and several suits of armor and items came up missing this way. I dug around and found out it only happened after someone had made a ship, and none of the ship building routines purged the items, so it must have been the area fold. I looked and ta-da, therein lied the problem, and commenting it out no longer purged rooms.

So, question, why are mobs not getting eaten by this if neither for loop checks for a prototype flag, and will commenting this out do any major harm aside from not purging items on an area fold? My builders are more than capable of removing prototype flags anyway and resetting objects correctly so this is of no concern to me.
       
Post is unread #2 Jul 1, 2009, 10:28 pm   Last edited Jul 1, 2009, 10:52 pm by Kayle
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Uh.. Why not just add a prototype check?

         for( obj = room->first_content; obj; obj = obj_next )
         {
            obj_next = obj->next_content;
            extract_obj( obj );
         }


Becomes
         for( obj = room->first_content; obj; obj = obj_next )
         {
            obj_next = obj->next_content;
            if( IS_SET( obj->extra_flags, ITEM_PROTOTYPE )
               extract_obj( obj );
         }


Disclaimer: Untested, and I can't even remember if that's the right field. So uh.. double check that if you use it.
       
Post is unread #3 Jul 1, 2009, 10:39 pm
Go to the top of the page
Go to the bottom of the page

Banner
Magician
GroupMembers
Posts169
JoinedNov 29, 2005

Banner said:

My builders are more than capable of removing prototype flags anyway and resetting objects correctly so this is of no concern to me.

And I know how to fix it, did you even read the last part of my post? :P
       
Post is unread #4 Jul 1, 2009, 10:53 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Yeah, but the reason I asked was because it would have been just as easy to add the prototype check instead of just commenting it out. :P
       
Post is unread #5 Jul 2, 2009, 9:47 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Updated local copy with fix, will make it official once I sleep.
       
Post is unread #6 Jul 2, 2009, 10:03 pm
Go to the top of the page
Go to the bottom of the page

Banner
Magician
GroupMembers
Posts169
JoinedNov 29, 2005


Kayle said:

Updated local copy with fix, will make it official once I sleep.

That was.. fast. Usually this process takes months. 8ducks*
       
Post is unread #7 Jul 2, 2009, 10:10 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Smartass. Just for that, I'm gonna take care of updating the bases now.
       
Post is unread #8 Jul 3, 2009, 6:29 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

Kayle said:

Updated local copy with fix, will make it official once I sleep.

Would it be safe to assume that the official solution will ave te added prototype check rather than a removal of a for loop?
       
Post is unread #9 Jul 3, 2009, 7:33 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Bugfixes were posted. And the packages were released. But yes, the prototype check was used in the official fix.
       
Post is unread #10 Jul 4, 2009, 11:23 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

Saw the posted bugfixes after I posted the question, but glad to see it. While Banner's builders may very well be inhumanly perfect, I suspect that the rest of the mudding community is filled with builders (and coders) who are either new enough to make that sort of mistake all too easily or who occasionally forget (or miss one) and, with his solution, would run a very real risk of crashing the mud because of it.
       
Pages:<< prev 1 next >>