version 1.138 | | version 1.139 |
---|
| | |
/* | | /* |
* static char *rcsid_player_c = | | * static char *rcsid_player_c = |
* "$Id: player.c,v 1.138 2003/11/02 04:17:00 mwedel Exp $"; | | * "$Id: player.c,v 1.139 2003/11/07 19:01:30 ryo_saeba Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
return NULL; | | return NULL; |
} | | } |
| | |
| | player* find_player_partial_name( char* plname )
|
| | {
|
| | player* pl;
|
| | player* found = NULL;
|
| | size_t namelen = strlen( plname );
|
| | for ( pl = first_player; pl != NULL; pl = pl->next )
|
| | {
|
| | if ( strlen( pl->ob->name ) < namelen )
|
| | continue;
|
| |
|
| | if ( !strncasecmp( pl->ob->name, plname, namelen ) )
|
| | {
|
| | if ( found )
|
| | return NULL;
|
| |
|
| | found = pl;
|
| | }
|
| | }
|
| | return found;
|
| | }
|
| | |
void display_motd(object *op) { | | void display_motd(object *op) { |
char buf[MAX_BUF]; | | char buf[MAX_BUF]; |
FILE *fp; | | FILE *fp; |
| | |
if(op->map == NULL || op->map->in_memory != MAP_IN_MEMORY) | | if(op->map == NULL || op->map->in_memory != MAP_IN_MEMORY) |
return 0; | | return 0; |
| | |
| | /* Sanity check: make sure dir is valid */
|
| | if ( ( dir < 0 ) || ( dir >= 9 ) )
|
| | {
|
| | LOG( llevError, "move_player: invalid direction %d\n", dir);
|
| | return 0;
|
| | }
|
| | |
/* peterm: added following line */ | | /* peterm: added following line */ |
if(QUERY_FLAG(op,FLAG_CONFUSED) && dir) | | if(QUERY_FLAG(op,FLAG_CONFUSED) && dir) |
dir = absdir(dir + RANDOM()%3 + RANDOM()%3 - 2); | | dir = absdir(dir + RANDOM()%3 + RANDOM()%3 - 2); |