Re: [code] This must be wrong.... <>

From: Kevin Doherty (kdoherty@JURAI.NET)
Date: 08/17/98

Thus spake George <greerga@CIRCLEMUD.ORG>:
>On Mon, 17 Aug 1998, Kevin Doherty wrote:
>>If ch->in_room is equal to X, wouldn't world[X].people _have_ to be
>>non-null, as presumably if ch thinks its in room X, room X thinks it
>>contains ch. I think the correct solution (though I have no source at hand
>>so I could be wrong) would be:
>Didn't notice the [ch->inroom] part.  Otherwise it would work. (If it
>worked with the inroom part, something is seriously wrong.)
>>  if (ch->next_in_room == NULL) {
>You may not be the first character in the room.  So try num_pc_in_room() or
>whatever it's called. :)

I'm hesitant to traverse the whole linked list when it's not necessary (of
course it's not my code :). But I think the following should be adequate:

if ((world[ch->in_room].people == ch) && (ch->next_in_room == NULL)) {

Kevin Doherty,
"Multiple exclamation marks are a sure sign of a diseased mind."
       -- Rincewind (from _Eric_)

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

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