Re: Anyone got guildguards to check align?

From: Scatter (scatter@onramp.net)
Date: 09/22/95


Howdy,

Got a strange thing going here, thought I'd throw it out.  Its 3am so it 
may be a really stupid question.

In mobact.c there is a loop that that goes through all the mobs looking 
for a spec proc.  I've modified the player_special_data to house a 
'MESSAGE' variable, so that I can have one mob 'trigger' another mob to act.
I've set up read_mobile to initialize the variable to a 'dirty' number so 
that when the spec proc for each mob is called, I can check the message 
variable to see if its dirty, and if so, initialize that mobs variables 
correctly.

For example:

A wizard decides its necessary to send a courier somewhere.  The code 
loads a courier into the room with the wizard and the wizard 
triggers this courier to travel to another mob. (this is done in the 
wizard's spec proc)  The first time the wizards proc is called, his 
message variable is 'dirty' so that means that the wizard needs to have some 
internal variables initialized, including the message variable.B (these 
variables are in player_special_data as well.)

The freaky thing I've found is this:  All my mobs seem to be using the 
same memory for their respective message variables.  So, when I change 
the message variable in one mob, they all change to the same thing.  
What?  Am I blind, stupid, or just plain geeky?  (My wife would agree to 
all of them :)  )

Ok, here's some code, just so I can say I put a snippet in :)
====================================================================
SPECIAL(overseer){
    struct char_data *courier;
    static int hour=0;

    switch(ch->player_specials->status){
        case DIRTY_SPEC:
            ch->player_specials->status=O_WAIT;
            return(FALSE);
        case O_KILLER_ALERT:
            actcol("$n leaps to his feet, and screams!",
                    FALSE, ch, 0, 0, TO_ROOM, KGRN);
            ch->player_specials->status=O_YELL;
            return(FALSE);
=====================================================================
When ever ch->player_specials->status is changed for one mob, all mobs 
that follow it in the character list have the same value in 
ch->player_specials->status.

Thanks for wading through all this, and any help would be greatly 
appreciated.

Julien,
Scourge, Inc.  linex1.linex.com 1995


=============================================================================

    \-----^----------------------^--        Snoogie(tm) Eliminator(tm)
    /       -----------------------/
   / ::::  -------------------/
  / :::: /  (  /
 / :::: /-----/
/______/        



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