Re: UM, hit()

From: Lincoln Chan (linc@CSUA.Berkeley.EDU)
Date: 07/24/95

Data:  You're gonna need to use a little C ability to solve this problem.
       It's really very easy and uses minimal C knowledge...

ACMD(do_diagnose) ... What is that?  Look in interpreter.h for the macro
ACMD and you find this:

#define ACMD(name)  \
   void (name)(struct char_data *ch, char *argument, int cmd, int subcmd)

That means that ACMD(do_diagnose) is just:

void do_diagnose(struct char_data *ch, char *argument, int cmd, int subcmd)

Now, in programming C, you need to use all the arguments in a subroutine.

So, you need to define who ch is, what the argument is, what the cmd number
is, and what the subcmd number is.  In this case, the argument is blank
(to diagnose the person you're in combat with), the cmd should be 0, the
subcmd should be 0.  And who's the ch?  The person who's doing the diagnosing
in hit(), and that person is ch.

[Note: the reason cmd and subcmd can be 0 is that if you look in
       ACMD(do_diagnose), int cmd and int subcmd aren't even used.  So
       they can be anything, really.]

So, instead of do_diagnose(victim), you need to do_diagnose(ch, "", 0, 0);

Simple, when you know where to look.  That's why I suggest looking at all
the main files...the info is there.

As a suggestion, don't put it in hit().  You'll get mega spammed with
diagnoses if your mud does anything with multihit (multiattack).  Put
it at the end of perform_violence() or something.

linc aka Aladdin of Eternity DikuMUD

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