From a7e4693eb670e2270680548c7fa33efdfb1ca3a6 Mon Sep 17 00:00:00 2001 From: Rumble Date: Fri, 5 Dec 2008 01:24:36 +0000 Subject: [PATCH] [Nov 23 2008] - Rumble Fixed a memory leak in quest.c create_obj. (thanks Jamdog) [Oct 21 2008] - Rumble Fixed display of wear locations and a typo. (thanks Kyle) --- changelog | 6 +++++- src/quest.c | 6 ++---- src/zedit.c | 12 ++++++++---- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/changelog b/changelog index fb70f3f..32a61f5 100644 --- a/changelog +++ b/changelog @@ -34,11 +34,15 @@ OLC copy and delete options. export (QQ's a zone into a tarball)t Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist) (lots of major bugfixes too) -@ + [Dec 04 2008] - Fizban DG Scripts are now attachable to players (cedit toggle defaults this behavior to off). [Dec 01 2008] - Fizban Now compiles warning free on GCC 4.3.2 +[Nov 23 2008] - Rumble + Fixed a memory leak in quest.c create_obj. (thanks Jamdog) +[Oct 21 2008] - Rumble + Fixed display of wear locations and a typo. (thanks Kyle) [Oct 09 2008] - Rumble Fixed a small bug in hedit. If CIRCLE_UNSIGNED_INDEX is 0, then new entries wo n't save correctly. (thanks Rhade) diff --git a/src/quest.c b/src/quest.c index f1f8e70..1f87401 100644 --- a/src/quest.c +++ b/src/quest.c @@ -306,13 +306,11 @@ void generic_complete_quest(struct char_data *ch) QST_EXP(rnum)); } if (QST_OBJ(rnum) && QST_OBJ(rnum) != NOTHING) { - if (real_object(QST_OBJ(rnum)) != NOTHING) { - if ((new_obj = create_obj()) != NULL) { - if ((new_obj = read_object((QST_OBJ(rnum)),VIRTUAL)) != NULL) { + if (real_object(QST_OBJ(rnum))) { + if ((new_obj = read_object((QST_OBJ(rnum)),VIRTUAL)) != NULL) { obj_to_char(new_obj, ch); send_to_char(ch, "You have been presented with %s%s for your service.\r\n", GET_OBJ_SHORT(new_obj), CCNRM(ch, C_NRM)); - } } } } diff --git a/src/zedit.c b/src/zedit.c index bca7081..919bb45 100644 --- a/src/zedit.c +++ b/src/zedit.c @@ -604,9 +604,13 @@ static void zedit_disp_arg3(struct descriptor_data *d) switch (OLC_CMD(d).command) { case 'E': while (*equipment_types[i] != '\n') { - write_to_output(d, "%2d) %26.26s %2d) %26.26s\r\n", i, - equipment_types[i], i + 1, (*equipment_types[i + 1] != '\n') ? - equipment_types[i + 1] : ""); + write_to_output(d, "%2d) %26.26s", i, equipment_types[i]); + + if (*equipment_types[i + 1] != '\n') + write_to_output(d, " %2d) %26.26s", i + 1, + equipment_types[i + 1]); + + write_to_output(d, "\r\n"); if (*equipment_types[i + 1] != '\n') i += 2; else @@ -962,7 +966,7 @@ void zedit_parse(struct descriptor_data *d, char *arg) more reliable. */ while (*equipment_types[i] != '\n') i++; - if (pos < 0 || pos > i) + if (pos < 0 || pos >= i) write_to_output(d, "Try again : "); else { OLC_CMD(d).arg3 = pos;