Re: receptionist actions

From: Daniel A. Koepke (dkoepke@circlemud.org)
Date: 02/10/02


On Thu, 7 Feb 2002, Daniel A. Koepke wrote:

> [...] the second checks if the special procedure has been invoked by
> something other than a command or NPC activity (i.e., fighting).

Replying to myself: this is incorrect.  I assumed that when called by
perform_violence(), the special procedure would have ch == FIGHTING(ch),
but this is incorrect.  It's also unfortunate because it makes it
impossible to differentiate between spec proc calls on mob and violence
pulses.

So here's what I'll do to fight.c:perform_violence(), barring any
objections:

- if (MOB_FLAGGED(ch, MOB_SPEC) && mob_index[GET_MOB_RNUM(ch)].func != \
NULL) {
+ if (MOB_FLAGGED(ch, MOB_SPEC) && GET_MOB_SPEC(ch) != NULL) {
    char actbuf[MAX_INPUT_LENGTH] = "";
-   (mob_index[GET_MOB_RNUM(ch)].func) (ch, ch, 0, actbuf);
+   (GET_MOB_SPEC(ch)) (FIGHTING(ch), ch, 0, actbuf);

This presents the three cases for mob spec procs:

Situation 1: Called by a command.
  ch =       Character who issued the command.
  cmd =      Number of the command in the command table.
  argument = Remainder of the command line.

Situation 2: Called by a mob pulse.
  ch =       The spec proc'd mobile.
  cmd =      0
  argument = ""

Situation 3: Called by a violence pulse (while NPC is fighting).
  ch =       Character the spec proc'd mobile is fighting.
  cmd =      0
  argument = ""

We'll have to audit existing mobile spec procs to ensure that none have
any gray area when this changes.  (For instance, the receptionist's
behavior would change to where she random does an action during a fight
with a PC.)

-dak

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