Re: Sneaking

From: Chris Gilbert (chris@buzzbee.freeserve.co.uk)
Date: 07/31/99


Jesper Andersen wrote:
>
> Greetings ...
> I noticed that its a pain a Immortal cant see when a person sneaks
> in/out of the room. I took a look at the code, but couldnt figure out a
> smart way to do it. Has any of you made something like that, or has any
> ideas to how you can do it. The problem is that the character is not the
> immortal, but the immortal is a ch in room, so I was thinking something
> about going through all the chars in the room. But it would take
> somecomputing every time .. perhaps there was a smarter way?

if you extend act() to have an extra type for sending to just imms in
the room, you only need to add about 3 extra lines of code.  In comm.h
add a new to type (eg TO_IMMS)  in comm.c find the act() func, towards
the bottom is a for loop into which you want to add the lines:
if (type==TO_IMMS && GET_LEVEL(to) < LVL_IMMORT)
        continue;

this now means that you can use act with a type of TO_IMMS, it'll act
just like TO_ROOM, but only goes to imms.

To add the bits to make sneak work find do_simple_move in act.movement.c
then find the bits with where it checks if the player is affected by
sneak, add an else case that calls act with TO_IMMS.

Normally I wouldn't actually post the code needed to do something, but
as this was something I'd been meaning to do I thought I'd do it now.
(took about 10 mins)  Standard disclaimers apply if it all blows up it's
not my fault.  If you've modified your act() then it's completely
possible this won't work.

What it does mean is that you can now send messages to just the imms
from anywhere.

Chris


     +------------------------------------------------------------+
     | 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