summaryrefslogtreecommitdiff
path: root/src/char_sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/char_sql')
-rw-r--r--src/char_sql/char.c6
1 files changed, 6 insertions, 0 deletions
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);