diff options
author | Inkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-10-27 13:54:23 +0000 |
---|---|---|
committer | Inkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-10-27 13:54:23 +0000 |
commit | 5612c2738964c0747ecf754b7cf5f834b3e09cef (patch) | |
tree | cc99b8951fbcce5503b1df3762fbf6ef17790c3f /src/map/intif.c | |
parent | 8868ae19d71ef5b73fe54d08471da78e0b2e9b38 (diff) | |
download | hercules-5612c2738964c0747ecf754b7cf5f834b3e09cef.tar.gz hercules-5612c2738964c0747ecf754b7cf5f834b3e09cef.tar.bz2 hercules-5612c2738964c0747ecf754b7cf5f834b3e09cef.tar.xz hercules-5612c2738964c0747ecf754b7cf5f834b3e09cef.zip |
Fixed quest will never get erased when it's the only quest you have.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14105 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/intif.c')
-rw-r--r-- | src/map/intif.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/map/intif.c b/src/map/intif.c index 9643338fa..a663a226e 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -1377,8 +1377,12 @@ int intif_parse_questlog(int fd) int intif_parse_questsave(int fd) { + TBL_PC *sd = map_id2sd(RFIFOL(fd, 2)); + if( !RFIFOB(fd, 6) ) - ShowError("intif_parse_questsave: Failed to save quest(s) for character %d!\n", RFIFOL(fd, 2)); + ShowError("intif_parse_questsave: Failed to save quest(s) for character %d!\n", sd->status.char_id); + else if( sd ) + sd->save_quest = false; return 0; } @@ -1396,7 +1400,8 @@ int intif_quest_save(TBL_PC *sd) WFIFOW(inter_fd,0) = 0x3061; WFIFOW(inter_fd,2) = len; WFIFOL(inter_fd,4) = sd->status.char_id; - memcpy(WFIFOP(inter_fd,8), &sd->quest_log, sizeof(struct quest)*sd->num_quests); + if( sd->num_quests ) + memcpy(WFIFOP(inter_fd,8), &sd->quest_log, sizeof(struct quest)*sd->num_quests); WFIFOSET(inter_fd, len); return 0; |