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, DotBot

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] 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, 3:08 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_DATA *victim;
   char arg1[MAX_INPUT_LENGTH];
   char arg2[MAX_INPUT_LENGTH];
   char arg3[MAX_INPUT_LENGTH];
   char logbuf[MAX_INPUT_LENGTH];
   long amount = 0;

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

   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|transfer> [amount] (character, if transfer)\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 if( !str_prefix( arg1, "transfer" ) )
   {
      victim = get_char_world( ch, arg3 );

      if( victim == NULL || IS_NPC( victim ) )
      {
         send_to_char( "They aren't here.\r\n", ch );
         return;
      }

      if( ch->top_level <= 10 )
      {
         send_to_char( "You must be level 11 or higher to use the bank transfer command.\r\n", ch );
         return;
      }

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

      if( amount <= 0 )
      {
         send_to_char( "You may only transfer amounts greater than zero.\r\n", ch );
         return;
      }
      if( victim->pcdata->bank > 0 && victim->pcdata->bank + amount < 0 )
      {
         send_to_char( "Their account cannot handle that much money!\r\n", ch );
         return;
      }
      ch_printf( ch, "&W&GYou transfer %ld credits to %s's account.\r\n", amount, arg3 );
      sprintf( logbuf, "%s transfers %ld credits to %s", ch->name, amount, victim->name );
      log_string( logbuf );
      ch->pcdata->bank -= amount;
      victim->pcdata->bank += amount;
      ch_printf( ch, "Successful.\r\n" );
      ch_printf( victim, "&W&G%s has deposited %ld credits into your account.\r\n", ch->name, amount );
      return;
   }
   else
   {
      do_bank( ch, "" );
      return;
   }
}


The arguments withdraw and balance are spelled wrong in the stock incarnation.
       
Pages:<< prev 1 next >>