diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-06-26 15:04:47 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-06-26 15:04:47 +0000 |
commit | c0e23cadf3d9f9cb8c91a9d99d252bcc72a6e79e (patch) | |
tree | 18f1e9cb0d716cd04aa4e1a5d803e860348cec07 | |
parent | d433baee079a3168b4bf26cf25ed55342c81990c (diff) | |
download | hercules-c0e23cadf3d9f9cb8c91a9d99d252bcc72a6e79e.tar.gz hercules-c0e23cadf3d9f9cb8c91a9d99d252bcc72a6e79e.tar.bz2 hercules-c0e23cadf3d9f9cb8c91a9d99d252bcc72a6e79e.tar.xz hercules-c0e23cadf3d9f9cb8c91a9d99d252bcc72a6e79e.zip |
Fixed quest index memory corruption when adding new quests (since r14039, bugreport:4982).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14867 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 2 | ||||
-rw-r--r-- | src/map/quest.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 29eccd9ee..dad2ae8da 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -1,5 +1,7 @@ Date Added +2011/06/26 + * Fixed quest index memory corruption when adding new quests (since r14039, bugreport:4982) [ultramage] 2011/06/25 * Added Mersenne Twister MT19937 as a random number generator. [FlavioJS] 2011/06/23 diff --git a/src/map/quest.c b/src/map/quest.c index 4960d8a93..4c890ce9e 100644 --- a/src/map/quest.c +++ b/src/map/quest.c @@ -85,7 +85,7 @@ int quest_add(TBL_PC * sd, int quest_id) i = sd->avail_quests; memmove(&sd->quest_log[i+1], &sd->quest_log[i], sizeof(struct quest)*(sd->num_quests-sd->avail_quests)); - memmove(sd->quest_index+i+1, sd->quest_log+i, sizeof(int)*(sd->num_quests-sd->avail_quests)); + memmove(sd->quest_index+i+1, sd->quest_index+i, sizeof(int)*(sd->num_quests-sd->avail_quests)); memset(&sd->quest_log[i], 0, sizeof(struct quest)); sd->quest_log[i].quest_id = quest_db[j].id; |