summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-12-29 05:16:01 +0300
committerAndrei Karas <akaras@inbox.ru>2019-01-14 20:18:11 +0300
commit42c129494a2b9f9899fb28fb5ca5792ee850ce07 (patch)
tree0fd2e8f3e3068c71f1460df82ee64b9f79da2eed /src/map/map.c
parent0f3a9dfaf79b0227944f2f4052dd48be3b2588f4 (diff)
downloadhercules-42c129494a2b9f9899fb28fb5ca5792ee850ce07.tar.gz
hercules-42c129494a2b9f9899fb28fb5ca5792ee850ce07.tar.bz2
hercules-42c129494a2b9f9899fb28fb5ca5792ee850ce07.tar.xz
hercules-42c129494a2b9f9899fb28fb5ca5792ee850ce07.zip
Add support for saving/loading barter shops from sql table.
Also allow add duplicated item id to barter shops if price is different.
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 93e86f80b..6212493c8 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -4479,6 +4479,7 @@ static bool inter_config_read_database_names(const char *filename, const struct
libconfig->setting_lookup_mutable_string(setting, "autotrade_merchants_db", map->autotrade_merchants_db, sizeof(map->autotrade_merchants_db));
libconfig->setting_lookup_mutable_string(setting, "autotrade_data_db", map->autotrade_data_db, sizeof(map->autotrade_data_db));
libconfig->setting_lookup_mutable_string(setting, "npc_market_data_db", map->npc_market_data_db, sizeof(map->npc_market_data_db));
+ libconfig->setting_lookup_mutable_string(setting, "npc_barter_data_db", map->npc_barter_data_db, sizeof(map->npc_barter_data_db));
if (!mapreg->config_read(filename, setting, imported))
retval = false;
@@ -6742,6 +6743,7 @@ int do_init(int argc, char *argv[])
npc->event_do_oninit( false ); // Init npcs (OnInit)
npc->market_fromsql(); /* after OnInit */
+ npc->barter_fromsql(); /* after OnInit */
if (battle_config.pk_mode)
ShowNotice("Server is running on '"CL_WHITE"PK Mode"CL_RESET"'.\n");