summaryrefslogtreecommitdiff
path: root/src/map/quest.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-12-06 16:43:59 +0100
committerHaru <haru@dotalux.com>2013-12-06 17:21:03 +0100
commit1f1930c0e3d2bb928d9fc9a39f360815daf77e8f (patch)
tree8f05ad76e514abac3b347dc9214603a9d7731711 /src/map/quest.c
parent2175dbec8fd4c0e691b2d3ad83e2dd78e834b8a8 (diff)
downloadhercules-1f1930c0e3d2bb928d9fc9a39f360815daf77e8f.tar.gz
hercules-1f1930c0e3d2bb928d9fc9a39f360815daf77e8f.tar.bz2
hercules-1f1930c0e3d2bb928d9fc9a39f360815daf77e8f.tar.xz
hercules-1f1930c0e3d2bb928d9fc9a39f360815daf77e8f.zip
Corrected some potential issues in the questlog system
- Should fixe bugreport:7888, thanks to rosfus http://hercules.ws/board/tracker/issue-7888-some-issue-crush-my-mapserver - Special thanks to Ind. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/quest.c')
-rw-r--r--src/map/quest.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/map/quest.c b/src/map/quest.c
index f2a6fae1f..bde276f9d 100644
--- a/src/map/quest.c
+++ b/src/map/quest.c
@@ -460,9 +460,9 @@ int quest_reload_check_sub(struct map_session_data *sd, va_list ap) {
}
j++;
}
- sd->num_quests = 0;
- ARR_FIND(sd->avail_quests, 0, j, sd->quest_log[j].state != Q_COMPLETE);
- sd->avail_quests = j+1;
+ sd->num_quests = j;
+ ARR_FIND(0, sd->num_quests, i, sd->quest_log[i].state == Q_COMPLETE);
+ sd->avail_quests = i;
return 1;
}