Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
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
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, Yahoo!, Bing, Google, DotBot

Members: 0
Guests: 11
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 » Bugfix Lists » SWR FUSS Bugfix List » [Bug] Misspelled arguments fo...
Forum Rules | Mark all | Recent Posts

[Bug] Misspelled arguments for bank command.
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Feb 4, 2010, 10:03 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

Bug: Misspelled arguments for bank command.
Danger: Trivial - Annoyance. Misspelled words are annoying. Especially when they impede the use of a command.
Found by: Caius
Fixed by: Kayle

---

misc.c, do_bank

Replace the whole thing with:
void do_bank( CHAR_DATA * ch, const char *argument )
{
   char arg1[MAX_INPUT_LENGTH];
   char arg2[MAX_INPUT_LENGTH];
   long amount = 0;

   argument = one_argument( argument, arg1 );
   argument = one_argument( argument, arg2 );

   if( IS_NPC( ch ) || !ch->pcdata )
      return;

   if( !ch->in_room || !IS_SET( ch->in_room->room_flags, ROOM_BANK ) )
   {
      send_to_char( "You must be in a bank to do that!\r\n", ch );
      return;
   }

   if( arg1[0] == '\0' )
   {
      send_to_char( "Usage: BANK <deposit|withdraw|balance> [amount]\r\n", ch );
      return;
   }

   if( arg2[0] != '\0' )
      amount = atoi( arg2 );

   if( !str_prefix( arg1, "deposit" ) )
   {
      if( amount <= 0 )
      {
         send_to_char( "You may only deposit amounts greater than zero.\r\n", ch );
         do_bank( ch, "" );
         return;
      }

      if( ch->gold < amount )
      {
         send_to_char( "You don't have that many credits on you.\r\n", ch );
         return;
      }

      ch->gold -= amount;
      ch->pcdata->bank += amount;

      ch_printf( ch, "You deposit %ld credits into your account.\r\n", amount );
      return;
   }
   else if( !str_prefix( arg1, "withdraw" ) )
   {
      if( amount <= 0 )
      {
         send_to_char( "You may only withdraw amounts greater than zero.\r\n", ch );
         do_bank( ch, "" );
         return;
      }

      if( ch->pcdata->bank < amount )
      {
         send_to_char( "You don't have that many credits in your account.\r\n", ch );
         return;
      }

      ch->gold += amount;
      ch->pcdata->bank -= amount;

      ch_printf( ch, "You withdraw %ld credits from your account.\r\n", amount );
      return;

   }
   else if( !str_prefix( arg1, "balance" ) )
   {
      ch_printf( ch, "You have %ld credits in your account.\r\n", ch->pcdata->bank );
      return;
   }
   else
   {
      do_bank( ch, "" );
      return;
   }
}


Easier than trying to make a code block for each of the changes.


       
Pages:<< prev 1 next >>