Login
User Name:

Password:



Register

Forgot your password?
do_owhere recursive
Author: Khonsu
Submitted by: Khonsu
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
Users Online
DotBot, AhrefsBot, Bing, Yandex

Members: 0
Guests: 28
Stats
Files
Topics
Posts
Members
Newest Member
489
3,792
19,646
597
Aileenutz

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » 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 5:08 pm   
Go to the top of the page
Go to the bottom of the page

InfiniteAxis
Off the Edge of the Map
GroupAdministrators
Posts1,200
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  [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 >>