--- MarkD <[EMAIL PROTECTED]> wrote:
> Hey list,
> This has been happening lately for no good reason that i can figure out.
> The mud has been crashing whenever someone uses the 'clan talk' command.
> Does anyone have any idea why this is crashing? Here's the gdb output (the
> clan talk command is below it)
>
> #0 get_trust (ch=0x0) at handler.c:729
> 729 if ( ch->desc != NULL && ch->desc->original != NULL )
> (gdb) bt
> #0 get_trust (ch=0x0) at handler.c:729
> #1 0x8075601 in do_clan_talk (ch=0x40704278,
> argument=0xbfffe8dd "Do I get to kill him?") at clan.c:1140
[SNIP]
So it looks like you're passing in a valid ch to do_clan_talk. but the arg to
get_trust is not valid.
>
> void do_clan_talk(CHAR_DATA *ch, char *argument)
> {
> DESCRIPTOR_DATA *d;
[SNIP]
All the stuff in here is ok, cause you aren't reassigning ch and we know it was
valid when it entered the function.
>
> for ( d = descriptor_list; d != NULL; d = d->next )
> {
> if ( (d->connected == CON_PLAYING &&
> d->character != ch &&
> is_same_clan(ch,d->character) &&
> !IS_SET(d->character->comm,COMM_NOCLAN) &&
> !IS_SET(d->character->comm,COMM_QUIET)) ||
> IS_IMMORTAL(d->character))
> {
[SNIP]
This is most likely the culprit. In the first part you check if
d->connected == CON_PLAYING. This will insure that d->character is
valid data. However, you have an OR condition for IS_IMMORTAL(d->character).
So if someone is connected to the mud, but not logged in yet, d->connected is
CON_GET_NAME (or something similiar) and d->character is NULL. Then someone in
the mud uses the clan channel. When d is the discriptor for the person looking
at the greeting the if check processes d->connected == CON_PLAYING and returns
FALSE to the call stack. Then it processes IS_IMMORTAL(d->character) which
results in a get_trust(d->character) which evaulates to get_trust(NULL). This
causes the mud to fall on it's face. I would suggest changing the check to:
if (d->connected == CON_PLAYING &&
d->character != ch &&
!IS_SET(d->character->comm,COMM_NOCLAN) &&
!IS_SET(d->character->comm,COMM_QUIET) &&
(
IS_IMMORTAL(d->character) || is_same_clan(ch,d->character)
))
Or however you want to format it. An even better solution though would be to
have is_same_clan return true if the first or second char is an immortal. Then
whenever an immortal uses the clan talk all clans would see it, and the
immortal could see all clan talk without the IS_IMMORTAL check here, etc. That
is assuming of course that you want immortals to be treated as though they
belonged to _EVERY_ clan which does seem to be the case from the logic you have
here..
~Kender
=====
-----BEGIN GEEK CODE BLOCK-----
Version 3.1
GCS/L/C/O d-(+) s++:+ a-- C+++$>++++ UBLS++++$
P+++(--)$ L++>+++ E--- W+>++$ N !o K? w(--) !O
M- !V PS+ PE(++) Y+ PGP->+ t- 5 X+() R(+) tv+@
b++(+++) !DI+++ D G(-) e>+++$ h---() r+++ y+++
------END GEEK CODE BLOCK------
__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/