Пример #1
0
/**
 * Close storage for player then save it
 * @param sd
 * @param flag
 */
void storage_guild_storage_quit(struct map_session_data* sd, int flag)
{
	struct s_storage *stor;

	nullpo_retv(sd);
	nullpo_retv(stor = guild2storage2(sd->status.guild_id));

	if (flag) {	//Only during a guild break flag is 1 (don't save storage)
		clif_storageclose(sd);

		if (save_settings&CHARSAVE_STORAGE)
			chrif_save(sd, CSAVE_INVENTORY|CSAVE_CART);

		sd->state.storage_flag = 0;
		stor->status = false;
		return;
	}

	if (stor->status) {
		if (save_settings&CHARSAVE_STORAGE)
			chrif_save(sd, CSAVE_INVENTORY|CSAVE_CART);
		else
			storage_guild_storagesave(sd->status.account_id,sd->status.guild_id,1);
	}

	sd->state.storage_flag = 0;
	stor->status = false;
}
Пример #2
0
int storage_guild_storage_quit(struct map_session_data* sd, int flag)
{
	struct guild_storage *stor;

	nullpo_ret(sd);
	nullpo_ret(stor=guild2storage2(sd->status.guild_id));

	if(flag)
	{	//Only during a guild break flag is 1 (don't save storage)
		sd->state.storage_flag = 0;
		stor->storage_status = 0;
		clif_storageclose(sd);
		if (save_settings&4)
			chrif_save(sd,0);
		return 0;
	}

	if(stor->storage_status) {
		if (save_settings&4)
			chrif_save(sd,0);
		else
			storage_guild_storagesave(sd->status.account_id,sd->status.guild_id,1);
	}
	sd->state.storage_flag = 0;
	stor->storage_status = 0;

	return 0;
}
Пример #3
0
/**
 * Close storage for player then save it
 * @param sd
 * @param flag
 */
void gstorage_storage_quit(struct map_session_data* sd, int flag)
{
	struct guild_storage *stor;

	nullpo_retv(sd);
	nullpo_retv(stor = gstorage_get_storage(sd->status.guild_id));

	if (flag) { // Only during a guild break flag is 1 (don't save storage)
		sd->state.storage_flag = 0;
		stor->opened = 0;
		clif_storageclose(sd);

		if (save_settings&CHARSAVE_STORAGE)
			chrif_save(sd,0);

		return;
	}

	if (stor->opened) {
		if (save_settings&CHARSAVE_STORAGE)
			chrif_save(sd,0);
		else
			gstorage_storagesave(sd->status.account_id,sd->status.guild_id,1);
	}

	sd->state.storage_flag = 0;
	stor->opened = 0;
}
Пример #4
0
/*==========================================
 * Modified By Valaris to save upon closing [massdriller]
 *------------------------------------------*/
void storage_storageclose(struct map_session_data* sd)
{
	nullpo_retv(sd);

	clif_storageclose(sd);

	if( save_settings&4 )
		chrif_save(sd,0); //Invokes the storage saving as well.

	sd->state.storage_flag = 0;
}
Пример #5
0
/**
 * Ack of storage has been saved
 * @param sd: Player who has the storage
 */
void storage_storagesaved(struct map_session_data *sd)
{
	if (!sd)
		return;

	if (&sd->storage)
		sd->storage.dirty = false;
	if (sd->state.storage_flag == 1) {
		sd->state.storage_flag = 0;
		clif_storageclose(sd);
	}
}
Пример #6
0
/**
 * Ack of secondary premium has been saved
 * @param sd Player who has the storage
 **/
void storage_premiumStorage_saved(struct map_session_data *sd) {
	if (!sd)
		return;

	if (&sd->premiumStorage) {
		sd->premiumStorage.dirty = 0;
	}
	if (sd->state.storage_flag == 3) {
		sd->state.storage_flag = 0;
		clif_storageclose(sd);
	}
}
Пример #7
0
/**
 * Make player close his storage
 * @param sd: Player who has the storage
 * @author [massdriller] / modified by [Valaris]
 */
void storage_storageclose(struct map_session_data *sd)
{
	nullpo_retv(sd);

	if (!&sd->storage)
		return;

	if (sd->storage.dirty) {
		intif_storage_save(sd, &sd->storage);
		if (sd->state.storage_flag == 1) {
			sd->state.storage_flag = 0;
			clif_storageclose(sd);
		}
	} else 
		storage_storagesaved(sd);
}
Пример #8
0
/**
 * Request to close premium storage
 * @param sd Player who has the storage
 * @author [Cydh]
 **/
void storage_premiumStorage_close(struct map_session_data *sd) {
	nullpo_retv(sd);

	if (!&sd->premiumStorage)
		return;

	if (sd->premiumStorage.dirty) {
		storage_premiumStorage_save(sd);
		if (sd->state.storage_flag == 3) {
			sd->state.storage_flag = 0;
			clif_storageclose(sd);
		}
	}
	else 
		storage_premiumStorage_saved(sd);
}
Пример #9
0
/**
 * Close storage for player then save it
 * @param sd : player
 */
void gstorage_storageclose(struct map_session_data *sd)
{
	struct guild_storage *stor;

	nullpo_retv(sd);
	nullpo_retv(stor = gstorage_get_storage(sd->status.guild_id));

	clif_storageclose(sd);
	if (stor->opened) {
		if (save_settings&4)
			chrif_save(sd, 0); //This one also saves the storage [Skotlex]
		else
			gstorage_storagesave(sd->status.account_id, sd->status.guild_id, 0);
		stor->opened = 0;
	}
	sd->state.storage_flag = 0;
}
Пример #10
0
/*==========================================
 * Modified By Valaris to save upon closing [massdriller]
 *------------------------------------------
 */
int storage_storageclose(struct map_session_data *sd)
{
	struct storage *stor;

	nullpo_retr(0, sd);
	nullpo_retr(0, stor=account2storage2(sd->status.account_id));

	clif_storageclose(sd);
	if (stor->storage_status)
  	{
		if (save_settings&4)
			chrif_save(sd,0); //Invokes the storage saving as well.
		else
			storage_storage_save(sd->status.account_id, 0);
	}
	stor->storage_status=0;
	sd->state.storage_flag=0;
	return 0;
}
Пример #11
0
/**
 * Close storage for player then save it
 * @param sd : player
 */
void storage_guild_storageclose(struct map_session_data* sd)
{
	struct s_storage *stor;

	nullpo_retv(sd);
	nullpo_retv(stor = guild2storage2(sd->status.guild_id));

	clif_storageclose(sd);
	if (stor->status) {
		if (save_settings&CHARSAVE_STORAGE)
			chrif_save(sd, 0); //This one also saves the storage. [Skotlex]
		else
			storage_guild_storagesave(sd->status.account_id, sd->status.guild_id,0);

		stor->status = false;
	}

	sd->state.storage_flag = 0;
}
Пример #12
0
//Close storage for sd and save it
int storage_guild_storageclose(struct map_session_data* sd)
{
	struct guild_storage *stor;

	nullpo_ret(sd);
	nullpo_ret(stor=guild2storage2(sd->status.guild_id));

	clif_storageclose(sd);
	if (stor->storage_status)
	{
		if (save_settings&4)
			chrif_save(sd, 0); //This one also saves the storage. [Skotlex]
		else
			storage_guild_storagesave(sd->status.account_id, sd->status.guild_id,0);
		stor->storage_status=0;
	}
	sd->state.storage_flag = 0;

	return 0;
}
Пример #13
0
/*==========================================
 * カプラ倉庫を閉じて保存
 *------------------------------------------
 */
void storage_storageclose(struct map_session_data *sd)
{
	struct storage *stor;

	nullpo_retv(sd);
	nullpo_retv(stor = (struct storage *)numdb_search(storage_db,sd->status.account_id));

	if(stor->dirty) {
		storage_sortitem(stor->store_item, MAX_STORAGE, &stor->sortkey, battle_config.personal_storage_sort);
		intif_send_storage(stor);
		if(battle_config.save_player_when_storage_closed) {
			chrif_save(sd,0);
		}
		stor->dirty = 0;
	}
	stor->storage_status   = 0;
	sd->state.storage_flag = 0;
	clif_storageclose(sd);

	return;
}