Use player_list/char_list to catch the linkdead people.

And please, even I do that after 15 years of being a C programmer, degree,
etc

heck today.

for(d=descriptor_list; d; d= d_next);

if (d->connected == CON_PLAYING)
....

That little semicolon got me for like 20 minutes.


----- Original Message -----
From: "Bobby Hicks" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[email protected]>
Sent: Sunday, February 10, 2002 4:10 PM
Subject: RE: hmm


> I agree with Edwin. Get a C book.  Just a note, what happens if the person
> is logged on, but does not have a descriptor(ie. linkdead)?
>
> Rheede
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Tom
> Whiting
> Sent: Sunday, February 10, 2002 3:58 PM
> To: [email protected]
> Subject: hmm
>
>
> Okay, I'm kind of perplexed here.. Maybe someone can see what I'm doing
> wrong here, or offer a better way of doing things.
> On DR, the relationship system is kinda, well, complex. The person
> starts out dating, works their way up to getting married, all done in
> stages, limited by a certain timer (for example, you can't ask someone
> to marry you if you've been dating less than 20 weeks, etc).
> Occasionally, this timer seems to not want to work. With some it will,
> yet with some others it won't.. Personally, I have never had a problem
> with it, but I know others it won't move for, won't budge.. Here's the
> code for the update.
>
>
> void spouse_update( void )
> {
>     DESCRIPTOR_DATA *d;
>     DESCRIPTOR_DATA *b;
>     CHAR_DATA *ch;
>     CHAR_DATA *victim;
>
>     for ( d = descriptor_list; d != NULL; d = d->next )
>     {
>         if (d->character != NULL && d->connected == CON_PLAYING)
>         {
>         ch = d->character; //this is me
>           for ( b = descriptor_list; b != NULL; b = b->next )
>           {
>
>         victim = b->original ? b->original : b->character; //this is my
> spouse
>
>         if (b->connected == CON_PLAYING &&
>             victim != ch &&
>             victim->pcdata->spouse == ch->name)
>
>         //are we online together?? If so, update the rtime
>         {
>         ch->pcdata->rtime ++ ;
>         victim->pcdata->rtime ++ ;
>         }
>           }
>         }
>     }
> return;
> }
>
> Can anyone see anything in here that might cause that to do that? I
> can't, myself.
>
>
>
> --
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom
>
>


Reply via email to