From e98991a2562ef1a8289e87ae306590c60cd32a66 Mon Sep 17 00:00:00 2001 From: amber Date: Tue, 21 Dec 2004 02:41:35 +0000 Subject: update git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@695 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/char_sql/char.c | 6 ++++++ src/map/storage.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/char_sql/char.c b/src/char_sql/char.c index 6b14b9192..47dba6f85 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -329,6 +329,12 @@ int mmo_char_tosql(int char_id, struct mmo_charstatus *p){ cp = numdb_search(char_db_,char_id); + if (cp == NULL) { + cp = (struct mmo_charstatus *) malloc(sizeof(struct mmo_charstatus)); + memset(cp, 0, sizeof(struct mmo_charstatus)); + numdb_insert(char_db_, char_id,cp); + } + save_flag = p->char_id; printf("(\033[1;32m%d\033[0m) %s \trequest save char data - ",char_id,char_dat[0].name); diff --git a/src/map/storage.c b/src/map/storage.c index 9c960f6d1..abc0a56e9 100644 --- a/src/map/storage.c +++ b/src/map/storage.c @@ -134,6 +134,8 @@ int storage_additem(struct map_session_data *sd,struct storage *stor,struct item nullpo_retr(1, stor); nullpo_retr(1, item_data); + stor->dirty = 1; + if(item_data->nameid <= 0 || amount <= 0) return 1; nullpo_retr(1, data = itemdb_search(item_data->nameid)); @@ -172,7 +174,6 @@ int storage_additem(struct map_session_data *sd,struct storage *stor,struct item return 1; } - stor->dirty = 1; return 0; } /*========================================== -- cgit v1.2.3-70-g09d2