The code:
void mprog_speech_trigger( char *txt, char_data * actor )
{
char_data *vmob;
list<char_data*>::iterator ich;
room_index *room = actor->in_room;
log_string( "HERE I AM" );
for( ich = room->people.begin(); ich != room->people.end(); )
{
vmob = (*ich);
ich++;
log_printf( "THIS IS ROOM: %d", room->vnum );
log_printf( "MY NAME IS: %s", vmob->name );
log_printf( "TEXT: %s", txt );
if( vmob->isnpc( ) && HAS_PROG( vmob->pIndexData, SPEECH_PROG ) )
{
if( actor->isnpc( ) && actor->pIndexData == vmob->pIndexData )
continue;
mprog_wordlist_check( txt, vmob, actor, NULL, NULL, SPEECH_PROG );
}
}
}
The mobprog:
>speech_prog p I am ready
if mobinroom(2868) == 1
mpecho The statue of Meia glows with a blue aura and animates.
say You are not yet ready to receive your reward and leave.
say Defeat the Guardian first.
mpecho The aura around the statue disappears and it is still again.
else
mpecho The statue of Meia glows with a blue aura and animates.
say You are now ready to leave the safety of Gwyn al'Fer.
say Fare thee well in your adventures in Alsherok.
give runed $n
say Take this as a reward and may it serve you well.
mpecho The aura around the statue disappears and it is still again.
mpecho You are drawn through a magical portal which opens before you.
mpopenpassage 2926 7035 4
mpforce $n up
mpclosepassage 2926 4
endif
What I caught in debugging:
Thu Aug 4, 2005 8:22:21 PM PDT :: Loading player data for Samson (37K)
Thu Aug 4, 2005 8:22:21 PM PDT :: Samson [samson.arthmoor.com] has connected.
Thu Aug 4, 2005 8:22:24 PM PDT :: MCCP support detected for Samson.
Thu Aug 4, 2005 8:22:24 PM PDT :: MSP support detected for Samson.
Thu Aug 4, 2005 8:22:24 PM PDT :: Samson returns from beyond the void.
Thu Aug 4, 2005 8:22:27 PM PDT :: HERE I AM
Thu Aug 4, 2005 8:22:27 PM PDT :: THIS IS ROOM: 2926
Thu Aug 4, 2005 8:22:27 PM PDT :: MY NAME IS: statue meia carving abecedarium
Thu Aug 4, 2005 8:22:27 PM PDT :: TEXT: i am ready
Thu Aug 4, 2005 8:22:27 PM PDT :: HERE I AM
Thu Aug 4, 2005 8:22:27 PM PDT :: THIS IS ROOM: 2926
Thu Aug 4, 2005 8:22:27 PM PDT :: MY NAME IS: statue meia carving abecedarium
Thu Aug 4, 2005 8:22:27 PM PDT :: TEXT: You are now ready to leave the safety of Gwyn al'Fer.
Thu Aug 4, 2005 8:22:27 PM PDT :: THIS IS ROOM: 2926
Thu Aug 4, 2005 8:22:27 PM PDT :: MY NAME IS: Samson
Thu Aug 4, 2005 8:22:27 PM PDT :: TEXT: You are now ready to leave the safety of Gwyn al'Fer.
Thu Aug 4, 2005 8:22:27 PM PDT :: HERE I AM
Thu Aug 4, 2005 8:22:27 PM PDT :: THIS IS ROOM: 2926
Thu Aug 4, 2005 8:22:27 PM PDT :: MY NAME IS: statue meia carving abecedarium
Thu Aug 4, 2005 8:22:27 PM PDT :: TEXT: Fare thee well in your adventures in Alsherok.
Thu Aug 4, 2005 8:22:27 PM PDT :: THIS IS ROOM: 2926
Thu Aug 4, 2005 8:22:27 PM PDT :: MY NAME IS: Samson
Thu Aug 4, 2005 8:22:27 PM PDT :: TEXT: Fare thee well in your adventures in Alsherok.
Thu Aug 4, 2005 8:22:27 PM PDT :: HERE I AM
Thu Aug 4, 2005 8:22:27 PM PDT :: THIS IS ROOM: 2926
Thu Aug 4, 2005 8:22:27 PM PDT :: MY NAME IS: statue meia carving abecedarium
Thu Aug 4, 2005 8:22:27 PM PDT :: TEXT: Take this as a reward and may it serve you well.
Thu Aug 4, 2005 8:22:27 PM PDT :: THIS IS ROOM: 2926
Thu Aug 4, 2005 8:22:27 PM PDT :: MY NAME IS: Samson
Thu Aug 4, 2005 8:22:27 PM PDT :: TEXT: Take this as a reward and may it serve you well.
Thu Aug 4, 2005 8:22:27 PM PDT :: THIS IS ROOM: 2926
==27643==
==27643== Invalid read of size 1
==27643== at 0x1D172F: vfprintf (in /lib/libc-2.3.5.so)
==27643== by 0x1EF76E: vsnprintf (in /lib/libc-2.3.5.so)
==27643== by 0x8153C86: log_printf(char const*, ...) (db.c:2560)
==27643== by 0x81AAF93: mprog_speech_trigger(char*, char_data*) (mud_prog.c:3500)
==27643== by 0x80D8EC0: do_say (act_comm.c:500)
==27643== by 0x814E6D7: interpret(char_data*, char*) (commands.c:1427)
==27643== by 0x81486AB: process_input() (comm.c:824)
==27643== by 0x814873A: game_loop() (comm.c:890)
==27643== by 0x8148A24: main (comm.c:1258)
==27643== Address 0x6 is not stack'd, malloc'd or (recently) free'd
==27643==
==27643== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ----
There are only two characters in room 2926. Myself and the mob Meia. This is a consistent crasher in this one function apparently. I have no idea why, and indications are that the room's list of people picked up something it wasn't supposed to as it got to the last say command in the prog, even though of course no other characters entered or left the room. Any ideas on what I can do now? |