[CODE] Need some advice.

From: Eamonn A. Sweeney (eamonnasweeney@EIRCOM.NET)
Date: 10/21/02


I need a little advice on something.
I added races and have a name database for players, when a player sees
another player for the first time they see a (sex) (race) stands here. Then
they can add that player to their database by typing add dwarf dumdum or
whatever name the dwarf gives (doesnt have to be their real name).
In get_char_vis/get_player_vis etc I have altered it so as the player can
target other players by race, ie look dwarf, look 2.dwarf etc. All visible
characters in a room are also numbered like this

[1] blahblah the Implementor stands here.
[2] an orc stands here.
[3] a male dwarf stands here.

in get_char_room_vis if there is no name (a player can type look 2. and
look at the orc) it searches by room number.
heres how I check in get_char_vis, KNOWN_NAME cycles through an array that
stores the idnums alongside whatever name the player added.

  if (isname(name, KNOWN_NAME(ch, i)) || isname(name, (race_types[(int)
GET_RACE(i)])))

now the problem, instead of reffering

  if (*number == 0)
    return (get_player_vis(ch, name, NULL, FIND_CHAR_ROOM));

from get_char_room_vis and get_char_world_vis I want to use get_player_vis
solely for wiz commands that target a player and use get_char_vis
everywhere else.

Im about to change something and I'm wondering if I am overlooking a
problem down the line.
get_player_vis
I cant stat/set/ etc a player who is invisible/hidden.

If I remove the if (can_see(ch, i)) and replace it with if (i->desc) I will
be able to target invisible/hidden players and I shouldnt crash the mud by
trying to use set/advance etc, on a linkdead player.

Is that the only reason it checks for visibility? And can you foresee any
problems?

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT