Explorar o código

Fixed quest index memory corruption when adding new quests (since r14039, bugreport:4982).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14867 54d463be-8e91-2dee-dedb-b68131a5f0ec
ultramage %!s(int64=14) %!d(string=hai) anos
pai
achega
d480c27293
Modificáronse 2 ficheiros con 3 adicións e 1 borrados
  1. 2 0
      Changelog-Trunk.txt
  2. 1 1
      src/map/quest.c

+ 2 - 0
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

+ 1 - 1
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;