From: Will Shaw <romulan@carol.net>
Subject: Autodiag code

All line numbers are relative to stock circle.


File fight.c
-------------
Around line 45, with the other external procedures, add:
....
void diag_char_to_char(struct char_data * i, struct char_data * ch);
....


Around line 880, add:
....
if (PRF_FLAGGED(ch, PRF_AUTODIAG) && !IS_NPC(ch) && FIGHTING(ch))
   diag_char_to_char(FIGHTING(ch), ch);
....
The above should come immediateley after the line:
hit(ch, FIGHTING(ch), TYPE_UNDEFINED);

If you have multihit code, it should not be much different; just make sure
you put the code in after all the hits have been dealt out, not after each
individual hit--kinda spammy that way.



File structs.h
--------------
Around line 176, add:
....
#define PRF_AUTODIAG		(1 << X)
....

    
File constants.c
----------------
/* PRF_x */
....
  "!GTZ",  
  "RMFLG", 
  "AUTODIAG",  <--- add this line
....


File act.other.c
----------------
Change the end of tog_messages (starts around line 789) to:
....
	{"Autoexits disabled.\r\n",
	"Autoexits enabled.\r\n"},
	{"Autodiag disabled.\r\n", 
	"Autodiag enabled.\r\n"}
};
....


Around line 878, just after the case for 'SCMD_AUTOEXIT', add:
....
	case SCMD_AUTODIAG:
	 result = PRF_TOG_CHK(ch, PRF_AUTODIAG);
       break;
....



File interpreter.h
------------------	
Around line 111, add:
....
#define SCMD_AUTODIAG	X
....



File interpreter.c
------------------
Somewhere in the Master Command List(tm), add:
....
 { "autodiag" , POS_DEAD    , do_gen_tog  , 0, SCMD_AUTODIAG },
....


That's all there is to it.  Updates and improvements are welcome...  Drop
me a line at romulan@carol.net if you have trouble with this code.

--
Will Shaw
romulan@carol.net
