Exemple #1
0
void buyingstore_close(struct map_session_data *sd)
{
	if(sd->state.buyingstore) {
		// invalidate data
		sd->state.buyingstore = false;
		memset(&sd->buyingstore, 0, sizeof(sd->buyingstore));

		// notify other players
		clif_buyingstore_disappear_entry(sd);
	}
}
Exemple #2
0
void buyingstore_close(struct map_session_data* sd)
{
	if( sd->state.buyingstore )
	{
		// invalidate data
		sd->state.buyingstore = false;
		memset(&sd->buyingstore, 0, sizeof(sd->buyingstore));

		// notify other players
		clif_buyingstore_disappear_entry(sd);

		if( map[sd->bl.m].flag.vending_cell ) // Cell becomes available again.
			map_setcell(sd->bl.m, sd->bl.x, sd->bl.y, CELL_NOVENDING, true);
	}
}
Exemple #3
0
void buyingstore_close(struct map_session_data* sd) {
	if( sd->state.buyingstore ) {
		if( !sd->state.autotrade )
			if( Sql_Query(mmysql_handle, "DELETE FROM `%s` WHERE buyingstore_id = %d;", buyingstore_items_db, sd->buyer_id) != SQL_SUCCESS ||
				Sql_Query(mmysql_handle, "DELETE FROM `%s` WHERE `id` = %d;", buyingstore_db, sd->buyer_id) != SQL_SUCCESS )
				Sql_ShowDebug(mmysql_handle);

		// Invalidate data
		sd->state.buyingstore = false;
		memset(&sd->buyingstore, 0, sizeof(sd->buyingstore));

		// Notify other players
		clif_buyingstore_disappear_entry(sd);
	}
}
Exemple #4
0
/**
 * Close buying store and clear buying store data from tables
 * @param sd
 */
void buyingstore_close(struct map_session_data *sd) {
	nullpo_retv(sd);

	if( sd->state.buyingstore ) {
		if( Sql_Query(mmysql_handle, "DELETE FROM `%s` WHERE buyingstore_id = %d;", buyingstore_items_db, sd->buyer_id) != SQL_SUCCESS ||
			Sql_Query(mmysql_handle, "DELETE FROM `%s` WHERE `id` = %d;", buyingstores_db, sd->buyer_id) != SQL_SUCCESS )
			Sql_ShowDebug(mmysql_handle);

		sd->state.buyingstore = 0;
		sd->buyer_id = 0;
		memset(&sd->buyingstore, 0, sizeof(sd->buyingstore));
		idb_remove(buyingstore_db, sd->status.char_id);

		// Notify other players
		clif_buyingstore_disappear_entry(sd);
	}
}