summaryrefslogtreecommitdiff
path: root/src/map/quest.c
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-09-04 11:38:09 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-09-04 11:38:09 +0000
commit616a2c8c15e2ab4e05481335f3d8798c0997da00 (patch)
tree80f605e6717173be7998530f463577ba586cdbaa /src/map/quest.c
parentda17744daf68cda8af6c74fcb11a8a284b807715 (diff)
downloadhercules-616a2c8c15e2ab4e05481335f3d8798c0997da00.tar.gz
hercules-616a2c8c15e2ab4e05481335f3d8798c0997da00.tar.bz2
hercules-616a2c8c15e2ab4e05481335f3d8798c0997da00.tar.xz
hercules-616a2c8c15e2ab4e05481335f3d8798c0997da00.zip
add missing memmove (follow up to r14036)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14038 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/quest.c')
-rw-r--r--src/map/quest.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/map/quest.c b/src/map/quest.c
index fa417d614..c110427a0 100644
--- a/src/map/quest.c
+++ b/src/map/quest.c
@@ -162,8 +162,12 @@ int quest_delete(TBL_PC * sd, int quest_id)
if( sd->quest_log[i].state != Q_COMPLETE )
sd->avail_quests--;
if( sd->num_quests-- < MAX_QUEST_DB && sd->quest_log[i+1].quest_id )
+ {
memmove(&sd->quest_log[i], &sd->quest_log[i+1], sizeof(struct quest)*(sd->num_quests-i));
+ memmove(sd->quest_index+i, sd->quest_index+i+1, sizeof(int)*(sd->num_quests-i));
+ }
memset(&sd->quest_log[sd->num_quests], 0, sizeof(struct quest));
+ sd->quest_index[sd->num_quests] = 0;
clif_send_quest_delete(sd, quest_id);