diff options
author | Dennis Friis <peavey@inspircd.org> | 2009-06-23 00:22:39 +0200 |
---|---|---|
committer | Dennis Friis <peavey@inspircd.org> | 2009-06-25 01:13:20 +0200 |
commit | 4b825f68fa8e8ec86d6aa1694f629ed348fe50f1 (patch) | |
tree | 54c4567fb51f8b1edb2cde224ea2ef6e7d994053 /src/map/map.c | |
parent | 353fd0ec49222512a4292fb1452c2c82c8e3a38d (diff) | |
download | tmwa-4b825f68fa8e8ec86d6aa1694f629ed348fe50f1.tar.gz tmwa-4b825f68fa8e8ec86d6aa1694f629ed348fe50f1.tar.bz2 tmwa-4b825f68fa8e8ec86d6aa1694f629ed348fe50f1.tar.xz tmwa-4b825f68fa8e8ec86d6aa1694f629ed348fe50f1.zip |
Redo storage, derived from ea stable.
Diffstat (limited to 'src/map/map.c')
-rw-r--r-- | src/map/map.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/map/map.c b/src/map/map.c index 1acae20..3faf492 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -988,10 +988,10 @@ int map_quit(struct map_session_data *sd) { pc_cleareventtimer(sd); // イベントタイマを破棄する - if(sd->state.storage_flag) - storage_guild_storage_quit(sd,0); - else + if(sd->state.storage_flag == 1) storage_storage_quit(sd); // 倉庫を開いてるなら保存する + else if(sd->state.storage_flag == 2) + storage_guild_storage_quit(sd,0); skill_castcancel(&sd->bl,0); // 詠唱を中断する skill_stop_dancing(&sd->bl,1);// ダンス/演奏中断 @@ -1023,8 +1023,14 @@ int map_quit(struct map_session_data *sd) { sd->status.skill[i].flag=0; } } - chrif_save(sd); - storage_storage_save(sd); + + //The storage closing routines will save the char if needed. [Skotlex] + if (!sd->state.storage_flag) + chrif_save(sd); + else if (sd->state.storage_flag == 1) + storage_storageclose(sd); + else if (sd->state.storage_flag == 2) + storage_guild_storageclose(sd); if( sd->npc_stackbuf && sd->npc_stackbuf != NULL) free( sd->npc_stackbuf ); @@ -1805,6 +1811,18 @@ void map_helpscreen() { exit(1); } +int compare_item(struct item *a, struct item *b) { + return ( + (a->nameid == b->nameid) && + (a->identify == b->identify) && + (a->refine == b->refine) && + (a->attribute == b->attribute) && + (a->card[0] == b->card[0]) && + (a->card[1] == b->card[1]) && + (a->card[2] == b->card[2]) && + (a->card[3] == b->card[3])); +} + /*====================================================== * Map-Server Init and Command-line Arguments [Valaris] *------------------------------------------------------ |