summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-07-26 09:52:08 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-07-26 09:52:08 +0000
commit53ba0c7362dffa576c58f7dc2decbeab0269d67b (patch)
tree4c5848b6868fc5c3427d8f4f168e4383f20a6897 /src/map
parente9a090774cb956ebb122698374be2a5360dd8b00 (diff)
downloadhercules-53ba0c7362dffa576c58f7dc2decbeab0269d67b.tar.gz
hercules-53ba0c7362dffa576c58f7dc2decbeab0269d67b.tar.bz2
hercules-53ba0c7362dffa576c58f7dc2decbeab0269d67b.tar.xz
hercules-53ba0c7362dffa576c58f7dc2decbeab0269d67b.zip
Fixed mob counts and quest states are not saved properly sometimes
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13964 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/pc.h1
-rw-r--r--src/map/quest.c10
-rw-r--r--src/map/script.c1
3 files changed, 6 insertions, 6 deletions
diff --git a/src/map/pc.h b/src/map/pc.h
index 925db7184..c219c8f45 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -380,7 +380,6 @@ struct map_session_data {
//Quest log system [Kevin] [Inkfish]
int num_quests;
int avail_quests;
- bool save_quest[MAX_QUEST_DB];
struct quest quest_log[MAX_QUEST_DB];
// temporary debug [flaviojs]
diff --git a/src/map/quest.c b/src/map/quest.c
index f146ca325..360cebd29 100644
--- a/src/map/quest.c
+++ b/src/map/quest.c
@@ -184,7 +184,7 @@ void quest_update_objective(TBL_PC * sd, int mob)
if( sd->quest_log[i].mob[j] == mob )
{
sd->quest_log[i].count[j]++;
- sd->save_quest[i] = true;
+ sd->quest_log[i].save_quest = true;
//clif_send_quest_info(sd, &sd->quest_log[i]); //TODO: Figure out the real packet [Inkfish]
//break;
}
@@ -207,7 +207,7 @@ int quest_update_status(TBL_PC * sd, int quest_id, int status)
if( status != Q_COMPLETE )
{
clif_send_quest_status(sd, quest_id, (bool)status);
- sd->save_quest[i] = true;
+ sd->quest_log[i].save_quest = true;
}
else
{
@@ -220,7 +220,7 @@ int quest_update_status(TBL_PC * sd, int quest_id, int status)
memcpy(&sd->quest_log[i], &sd->quest_log[sd->avail_quests],sizeof(struct quest));
memcpy(&sd->quest_log[sd->avail_quests], &tmp_quest,sizeof(struct quest));
- sd->save_quest[sd->avail_quests] = true;
+ sd->quest_log[sd->avail_quests].save_quest = true;
}
return 0;
@@ -231,7 +231,7 @@ int quest_save(TBL_PC * sd)
int i;
for( i = 0; i < sd->num_quests; i++ )
- if( sd->save_quest[i] )
+ if( sd->quest_log[i].save_quest )
intif_quest_save(sd->status.char_id, &sd->quest_log[i]);
return 0;
@@ -253,7 +253,7 @@ int quest_save_ack(int char_id, int quest_id, int success)
return -1;
if(success)
- sd->save_quest[i] = false;
+ sd->quest_log[i].save_quest = false;
else
{
ShowError("Quest %d for character %d could not be saved!\n", quest_id, char_id);
diff --git a/src/map/script.c b/src/map/script.c
index fd1fa5b0e..a2a60c13d 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -13447,6 +13447,7 @@ BUILDIN_FUNC(completequest)
TBL_PC * sd = script_rid2sd(st);
quest_update_status(sd, script_getnum(st, 2), Q_COMPLETE);
+ intif_quest_save(sd->status.char_id, &sd->quest_log[sd->avail_quests]);
return 0;
}