|
@@ -78,14 +78,14 @@ int8 buyingstore_setup(struct map_session_data* sd, unsigned char slots){
|
|
|
return 2;
|
|
|
}
|
|
|
|
|
|
- if( map_getmapflag(sd->bl.m, MF_NOVENDING) )
|
|
|
- {// custom: no vending maps
|
|
|
+ if( map_getmapflag(sd->bl.m, MF_NOBUYINGSTORE) )
|
|
|
+ {// custom: no buyingstore maps
|
|
|
clif_displaymessage(sd->fd, msg_txt(sd,276)); // "You can't open a shop on this map"
|
|
|
return 3;
|
|
|
}
|
|
|
|
|
|
- if( map_getcell(sd->bl.m, sd->bl.x, sd->bl.y, CELL_CHKNOVENDING) )
|
|
|
- {// custom: no vending cells
|
|
|
+ if( map_getcell(sd->bl.m, sd->bl.x, sd->bl.y, CELL_CHKNOBUYINGSTORE) )
|
|
|
+ {// custom: no buyingstore cells
|
|
|
clif_displaymessage(sd->fd, msg_txt(sd,204)); // "You can't open a shop on this cell."
|
|
|
return 4;
|
|
|
}
|
|
@@ -145,14 +145,14 @@ int8 buyingstore_create( struct map_session_data* sd, int zenylimit, unsigned ch
|
|
|
return 2;
|
|
|
}
|
|
|
|
|
|
- if( map_getmapflag(sd->bl.m, MF_NOVENDING) )
|
|
|
- {// custom: no vending maps
|
|
|
+ if( map_getmapflag(sd->bl.m, MF_NOBUYINGSTORE) )
|
|
|
+ {// custom: no buyingstore maps
|
|
|
clif_displaymessage(sd->fd, msg_txt(sd,276)); // "You can't open a shop on this map"
|
|
|
return 3;
|
|
|
}
|
|
|
|
|
|
- if( map_getcell(sd->bl.m, sd->bl.x, sd->bl.y, CELL_CHKNOVENDING) )
|
|
|
- {// custom: no vending cells
|
|
|
+ if( map_getcell(sd->bl.m, sd->bl.x, sd->bl.y, CELL_CHKNOBUYINGSTORE) )
|
|
|
+ {// custom: no buyingstore cells
|
|
|
clif_displaymessage(sd->fd, msg_txt(sd,204)); // "You can't open a shop on this cell."
|
|
|
return 4;
|
|
|
}
|
|
@@ -798,6 +798,20 @@ static int buyingstore_autotrader_free(DBKey key, DBData *data, va_list ap) {
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+* Update buyer location
|
|
|
+* @param sd: Player's session data
|
|
|
+*/
|
|
|
+void buyingstore_update(map_session_data &sd)
|
|
|
+{
|
|
|
+ if (Sql_Query(mmysql_handle, "UPDATE `%s` SET `map` = '%s', `x` = '%d', `y` = '%d', `body_direction` = '%d', `head_direction` = '%d', `sit` = '%d', `autotrade` = '%d' WHERE `id` = '%d'",
|
|
|
+ buyingstores_table, map_getmapdata(sd.bl.m)->name, sd.bl.x, sd.bl.y, sd.ud.dir, sd.head_dir, pc_issit(&sd), sd.state.autotrade,
|
|
|
+ sd.buyer_id
|
|
|
+ ) != SQL_SUCCESS) {
|
|
|
+ Sql_ShowDebug(mmysql_handle);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* Initialise the buyingstore module
|
|
|
* called in map::do_init
|