Re: Abbreviate acting strange?

From: Angus Mezick (amezick@edgil.com)
Date: 12/08/98


COOL! someone is using my code :)
here is what I have for bash:


ACMD(do_bash)
{
   struct char_data *vict;
   int percent, prob;
   char *arg=get_buffer(MAX_INPUT_LENGTH);

   one_argument(argument, arg);

   vict=NULL;
   if ((!*arg)&&FIGHTING(ch))
      vict = FIGHTING(ch);
   else if(*arg)
      vict = get_char_room_vis(ch, arg);

   if(vict==NULL)
      {
      send_to_char("Bash who???\r\n", ch);
      release_buffer(arg);
      return;
      }
   release_buffer(arg);


Have you checked to see what is contained in argument with either
your debugger or a simple log("bash_arg_test %s",argument);?

--Angus
------------------------------------------------------------------------

Hiya all

fiddeling with abbreviation code, plugged the one from the Archives
(Angus' work) in and gee it works right away.

Yet somehow things go haywire and I cannot see why except it's the
Abbreviate code that's acting up.

Heres the situation :
1. A attacks mob.
2. B Assists A
3. A being a warrior bashes the opponent with the command "bash" no
arguments

See under normal circumstances this would give opponent fighting and A
would bash the opponent, but here it actually bashes B instead. Totalt
confusion.

Bash code looks like the following.. anyone with an idea to what the
problem *MIGHT* be, except that the abbreviate code sends an Argument
through anyway?

ACMD(do_bash)
{
  struct char_data *vict = NULL;
  int percent, prob;

  if(!check_for_skill(ch, SKILL_BASH)) return;

  if (!*argument) { /* No Argument */
   if (FIGHTING(ch)) {
    vict = FIGHTING(ch);
   } else {
    send_to_char("Bash who?\r\n", ch);
   }
  }

  one_argument(argument, arg);
  log(argument);

  if (!(vict = get_char_room_vis(ch, arg))) {
   send_to_char("Bash who?\r\n", ch);
   return;
  }


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST