diff --git a/changelog b/changelog index 0a293a1..d9e0256 100644 --- a/changelog +++ b/changelog @@ -3,9 +3,11 @@ help, find any bugs, or have ideas for improvement please stop by TBA at telnet://tbamud.com:9091 or email rumble@tbamud.com --Rumble tbaMUD 3.56 -[May 17 2008] +[May 17 2008] - Rumble + Fixed a possible crash bug in qedit. (thanks Jamdog) Bug fix: Page command was paging when the character was not found and sending a NOPERSON message when he was found. [May 15 2008] - Rumble + Fixed a bug where deleting the last quest in qedit caused a crash. (thanks Jamdog) Updated autorun to fix a random syslog numbering bug. (thanks Zizazat) [May 10 2008] - Rumble Fixed another typo, added a check for !NPC do_gen_comm, and changed do_return to only run autowiz if level changes. (thanks Fizban) diff --git a/src/genqst.c b/src/genqst.c index cd0725c..3dfe2e0 100644 --- a/src/genqst.c +++ b/src/genqst.c @@ -107,10 +107,11 @@ int add_quest(struct aq_data *nqst) copy_quest(&aquest_table[rnum], nqst, FALSE); } /* Make sure we assign spec procs to the questmaster */ - if (mob_index[QST_MASTER(rnum)].func && + if (QST_MASTER(rnum) != NOBODY && mob_index[QST_MASTER(rnum)].func && mob_index[QST_MASTER(rnum)].func != questmaster) QST_FUNC(rnum) = mob_index[QST_MASTER(rnum)].func; - mob_index[QST_MASTER(rnum)].func = questmaster; + if(QST_MASTER(rnum) != NOBODY) + mob_index[QST_MASTER(rnum)].func = questmaster; /* And make sure we save the updated quest information to disk */ if (rznum != NOWHERE) @@ -145,7 +146,10 @@ int delete_quest(qst_rnum rnum) aquest_table[i] = aquest_table[i + 1]; } total_quests--; - RECREATE(aquest_table, struct aq_data, total_quests); + if (total_quests > 0) + RECREATE(aquest_table, struct aq_data, total_quests); + else + free(aquest_table); if (rznum != NOWHERE) add_to_save_list(zone_table[rznum].number, SL_QST);