Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 parse description bug
Yesterday, 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
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
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, DotBot, Yahoo!

Members: 0
Guests: 9
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » Locker Issue
Forum Rules | Mark all | Recent Posts

Locker Issue
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Jun 15, 2011, 11:57 pm
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

For some reason if a person buys a locker for the first time, while someone that already has a locker is in the room, the locker will overwrite the older persons. The older person can open this broken locker multiple times.
Locker Example:
This is the older persons locker with the new persons name on it
#LOCKER
Name         Kasai~
ShortDescr   the locker of Kasai~
Description  The locker of Kasai stands open here.~
Vnum         8048853
Origin       4, UNKNOWN~
Room         8048749
ExtraFlags   0&0&1073741824
Values       1000 0 0 0 0 0
End

#OBJECT
Nest         1
Name         Dinner death certificate~
ShortDescr   Dinner's death certificate~
Vnum         610
Origin       4, UNKNOWN~
ExtraDescr   Dinner death certificate~ Certificate of Death

--------------------

Name: &WDinner&w

Rank: &WHardcore&w

Sex : &WMale&w  Race: &WBio-android&w

Cause of Death: &WHomicide&w

Time of Death : &WSat May  7 11:30:52 2011

&wArea of the Crime : &WNew South City&w

Scene of the Crime: &W&WS&zouth &WC&zity &WS&zquare&D&w

Suspect Information

-------------------

Name: &WElitxjinn&w

Rank: &WHardcore&w

Sex : &WMale&w  Race: &WBio-android&w

Reason for Involvement:

  &W'Possible' Self Defense&w

~
End

#END 


Here is the code for opening a locker
    if( ! str_cmp( arg, "open" ) )
    {
        if (ch->in_room->vnum != ROOM_LOCKER)
        {
            send_to_char( "Does this smell like a locker room to you?\r\n", ch );
            return;
        } 

        for( locker = ch->in_room->first_content; locker ; locker = locker->next_content)
        {
           if( !str_cmp( locker->name, ch->name ) )
              break;

        }
                                                
        if (locker)
        {
            send_to_char("Your locker is already open.\n\r",ch);
            return;
        }
           
        sprintf( strsave, "%s%s", LOCKER_DIR, capitalize( ch->name ) );
    
        if ( ( fp = fopen( strsave, "r" ) ) != NULL )
        {
          for ( ; ; )
          {
            char letter;
            char *word;
            
            letter = fread_letter( fp );
            if ( letter == '#')
            {
              word = fread_word( fp );
  
              if( !strcmp( word, "LOCKER" ) )
                 fread_obj( ch, fp, OS_LOCKER );
              else if (!strcmp(word,"OBJECT";))
                 fread_obj( ch, fp, OS_CARRY );
              else if (!strcmp(word,"END" ))
                   break;
            }
          }    
          fclose( fp );
        }

        else
        {                                                
          if (ch->gold < 1000000)
          {
            send_to_char("You do not have enough zeni to create a locker.\n\r",ch);
            return;
          }
          
          ch->gold -= 1000000;
          locker = create_object(get_obj_index(OBJ_VNUM_LOCKER),0);
          sprintf(buf, locker->name, ch->name);
          STRFREE( locker->name);
          locker->name = STRALLOC(buf);
          sprintf(buf, locker->short_descr, ch->name);
          STRFREE( locker->short_descr);
          locker->short_descr = STRALLOC(buf);
          sprintf(buf, locker->description, ch->name);
          STRFREE( locker->description);
          locker->description = STRALLOC(buf);
          obj_to_room( locker, ch->in_room );
	  xTOGGLE_BIT( locker->extra_flags, ITEM_LOCKER );
        }
        act(AT_TELL, "$n opens $s locker.",ch, NULL, NULL, TO_ROOM);
 	act(AT_TELL, "You open your locker.",ch, NULL, NULL, TO_CHAR);
     }
       
Post is unread #2 Jun 16, 2011, 12:20 am
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

I found the issue, do_put checking to make sure the locker was theirs
       
Pages:<< prev 1 next >>