summaryrefslogtreecommitdiff
path: root/src/char_sql/char.c
diff options
context:
space:
mode:
authorKevin <Kevin@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-13 22:19:02 +0000
committerKevin <Kevin@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-13 22:19:02 +0000
commite5242b4b3842fc94a60ad2f66284162948baefeb (patch)
tree8023e522ce29b67adb11c5db33dc0e71c27d04b1 /src/char_sql/char.c
parent40a44f83fc8c640412af6e4f227106eea9c17003 (diff)
downloadhercules-e5242b4b3842fc94a60ad2f66284162948baefeb.tar.gz
hercules-e5242b4b3842fc94a60ad2f66284162948baefeb.tar.bz2
hercules-e5242b4b3842fc94a60ad2f66284162948baefeb.tar.xz
hercules-e5242b4b3842fc94a60ad2f66284162948baefeb.zip
Major updates to the quest system.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12581 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql/char.c')
-rw-r--r--src/char_sql/char.c72
1 files changed, 1 insertions, 71 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 9afd6b59d..2eca9b929 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -431,7 +431,7 @@ int mmo_char_tosql(int char_id, struct mmo_charstatus* p)
int diff = 0;
char save_status[128]; //For displaying save information. [Skotlex]
struct mmo_charstatus *cp;
- StringBuf buf, buf2;
+ StringBuf buf;
if (char_id!=p->char_id) return 0;
@@ -644,76 +644,6 @@ int mmo_char_tosql(int char_id, struct mmo_charstatus* p)
strcat(save_status, " friends");
}
- StringBuf_Clear(&buf);
- StringBuf_Printf(&buf, "REPLACE INTO `%s` (`char_id`, `quest_id`, `state`) VALUES ", quest_db);
- for(i=0; i<MAX_QUEST; i++)
- {
-
- if(p->quest_log[i].quest_id)
- {
- if(diff)
- StringBuf_AppendStr(&buf, ",");
- StringBuf_Printf(&buf, "('%d', '%d', '%d')", p->char_id, p->quest_log[i].quest_id, p->quest_log[i].state);
- diff = 1;
- }
-
- }
-
- if(diff) {
- if( SQL_ERROR == Sql_QueryStr(sql_handle, StringBuf_Value(&buf)) )
- Sql_ShowDebug(sql_handle);
- else
- strcat(save_status, " hotkeys");
- }
-
- //save quests
- StringBuf_Init(&buf2);
- StringBuf_Clear(&buf);
- StringBuf_Clear(&buf2);
- diff = 0;
- StringBuf_Printf(&buf, "REPLACE INTO `%s` (`char_id`, `quest_id`, `state`) VALUES ", quest_db);
- for(i=0; i<MAX_QUEST; i++)
- {
-
- if(p->quest_log[i].quest_id)
- {
- if(diff)
- StringBuf_AppendStr(&buf, ",");
- StringBuf_Printf(&buf, "('%d', '%d', '%d')", p->char_id, p->quest_log[i].quest_id, p->quest_log[i].state);
- diff = 1;
-
- StringBuf_Printf(&buf2, "REPLACE INTO `%s` (`quest_id`, `num`, `name`, `count`) VALUES ", quest_obj_db);
- count = 0;
- for(j=0; j<p->quest_log[i].num_objectives; j++)
- {
-
- if(p->quest_log[i].objectives[j].name)
- {
-
- if(count)
- StringBuf_AppendStr(&buf2, ",");
- StringBuf_Printf(&buf2, "('%d', '%d', '%s', '%d')", p->quest_log[i].quest_id, j, p->quest_log[i].objectives[j].name, p->quest_log[i].objectives[j].count);
- count = 1;
-
- }
- }
-
- if(count) {
- if( SQL_ERROR == Sql_QueryStr(sql_handle, StringBuf_Value(&buf2)) )
- Sql_ShowDebug(sql_handle);
- }
- }
- }
-
- if(diff) {
- if( SQL_ERROR == Sql_QueryStr(sql_handle, StringBuf_Value(&buf)) )
- Sql_ShowDebug(sql_handle);
- else
- strcat(save_status, " quests");
- }
-
- StringBuf_Destroy(&buf2);
-
#ifdef HOTKEY_SAVING
// hotkeys
StringBuf_Clear(&buf);