diff options
author | Haru <haru@dotalux.com> | 2017-05-27 19:24:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-27 19:24:42 +0200 |
commit | cb3e2f5f3b91d0a1f7711eff9c10ae9a655a74f2 (patch) | |
tree | 1b1df55f4143bae6bed85093f3424b6af11e4a01 /src/char/char.c | |
parent | be118c7fad6df29dc691452ef511ac12fea37a06 (diff) | |
parent | d966a8e6860d418bb3a235e57928436127eba555 (diff) | |
download | hercules-cb3e2f5f3b91d0a1f7711eff9c10ae9a655a74f2.tar.gz hercules-cb3e2f5f3b91d0a1f7711eff9c10ae9a655a74f2.tar.bz2 hercules-cb3e2f5f3b91d0a1f7711eff9c10ae9a655a74f2.tar.xz hercules-cb3e2f5f3b91d0a1f7711eff9c10ae9a655a74f2.zip |
Merge pull request #1722 from Smokexyz/mmo_charstatus-fix
Dismemberment of `storage_data` from `mmo_charstatus`.
Diffstat (limited to 'src/char/char.c')
-rw-r--r-- | src/char/char.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/char/char.c b/src/char/char.c index 93078f8ee..487bec763 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -287,11 +287,17 @@ void char_set_char_offline(int char_id, int account_id) } else { - struct mmo_charstatus* cp = (struct mmo_charstatus*)idb_get(chr->char_db_,char_id); + struct mmo_charstatus* cp = (struct mmo_charstatus*) idb_get(chr->char_db_,char_id); + struct storage_data *stor = (struct storage_data *) idb_get(inter_storage->account_storage, account_id); + inter_guild->CharOffline(char_id, cp?cp->guild_id:-1); + if (cp) idb_remove(chr->char_db_,char_id); + if (stor) /* Remove inter-storage data. */ + idb_remove(inter_storage->account_storage, account_id); + if( SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `online`='0' WHERE `char_id`='%d' LIMIT 1", char_db, char_id) ) Sql_ShowDebug(inter->sql_handle); } @@ -442,14 +448,6 @@ int char_mmo_char_tosql(int char_id, struct mmo_charstatus* p) errors++; } - //map storage data - if( memcmp(p->storage.items, cp->storage.items, sizeof(p->storage.items)) ) { - if (!chr->memitemdata_to_sql(p->storage.items, MAX_STORAGE, p->account_id, TABLE_STORAGE)) - strcat(save_status, " storage"); - else - errors++; - } - if ( (p->base_exp != cp->base_exp) || (p->base_level != cp->base_level) || (p->job_level != cp->job_level) || (p->job_exp != cp->job_exp) || @@ -1284,10 +1282,6 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every strcat(t_msg, " cart"); - //read storage - inter_storage->fromsql(p->account_id, &p->storage); - strcat(t_msg, " storage"); - //read skill //`skill` (`char_id`, `id`, `lv`) memset(&tmp_skill, 0, sizeof(tmp_skill)); |