summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-11-27 03:21:45 +0100
committerHaru <haru@dotalux.com>2013-12-03 16:28:08 +0100
commit6f55c00e72ca6db130a84fe92218f73a777428f4 (patch)
treee3f25d1ad5b3dbb06371941fc9fd8cb66a5411a9 /src/map/unit.c
parent470ab15023f09dc823e8ce8ac818e0bbe8a95aef (diff)
downloadhercules-6f55c00e72ca6db130a84fe92218f73a777428f4.tar.gz
hercules-6f55c00e72ca6db130a84fe92218f73a777428f4.tar.bz2
hercules-6f55c00e72ca6db130a84fe92218f73a777428f4.tar.xz
hercules-6f55c00e72ca6db130a84fe92218f73a777428f4.zip
Questlog fixes
- Improved memory usage of the quest log system. (saves up to 75kB per online character). Fixes issue #133. - Fixed various issues with quest entries disappearing from characters without an apparent reason, or monster kill counters getting stuck - the issues were caused by a de-synchronization between the two parallel questlog arrays in map_session_data. - Added some code documentation. - Thanks to Ind. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 872ad1f8b..28dd68e7d 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -2393,6 +2393,11 @@ int unit_free(struct block_list *bl, clr_type clrtype) {
aFree(sd->queues);
sd->queues = NULL;
}
+ if( sd->quest_log != NULL ) {
+ aFree(sd->quest_log);
+ sd->quest_log = NULL;
+ sd->num_quests = sd->avail_quests = 0;
+ }
for( k = 0; k < sd->hdatac; k++ ) {
if( sd->hdata[k]->flag.free ) {