Re: [Code Help] Abbreviations

From: Benjamin Draper (
Date: 06/15/00

> Jan Pedersen wrote:
> the code compiles fine, but in the game the implementor can use it
> like tell sla(for slayer) message
> but everyone else get this message: No-one by that name here when
> trying to use short names.
> anyone have any idea why it dont work with bpl17

 The problem is in get_player_vis() in handler.c, which is called by
get_char_vis() in do_tell. The code snippet below is from Circle30bpl17:

struct char_data *get_player_vis(struct char_data * ch, char *name, int
  struct char_data *i;

  for (i = character_list; i; i = i->next) {
    if (IS_NPC(i))
    if (inroom == FIND_CHAR_ROOM && i->in_room != ch->in_room)
    if (str_cmp(i->, name)) /* If not same, continue */
    if (!CAN_SEE(ch, i))
    return (i);

  return (NULL);

 The line I've marked uses str_cmp to wholly match what a player entered
and the name of the character currently being checked. This will of
course appear to be like stock isname, but you probably won't notice the
problem until you add in the abbreviation snippet. A simple fix is to
change the marked line to:

    if (!isname(name, i-> /* If not same, continue */

 I first noticed this a couple of patch levels ago, only I forgot to
mention it at the time. It isn't a bug, but wouldn't it make sense to
use isname for the sake of consistency? Obviously George/DAK/Chris
Gilbert, correct me if I'm wrong!


-> Ben

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

This archive was generated by hypermail 2b30 : 04/10/01 PDT