summaryrefslogtreecommitdiff
path: root/src/map/itemdb.c
diff options
context:
space:
mode:
authorKisuka <Kisuka@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-03-09 12:50:24 +0000
committerKisuka <Kisuka@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-03-09 12:50:24 +0000
commit5cca96bf950bcd9586ab04f0e0f2b5d9a556c5e0 (patch)
tree1f546bf12a99017b41ae2fd90e0ac452f97b0282 /src/map/itemdb.c
parentb4208257ea0906e375024f811d8e51208d539d35 (diff)
downloadhercules-5cca96bf950bcd9586ab04f0e0f2b5d9a556c5e0.tar.gz
hercules-5cca96bf950bcd9586ab04f0e0f2b5d9a556c5e0.tar.bz2
hercules-5cca96bf950bcd9586ab04f0e0f2b5d9a556c5e0.tar.xz
hercules-5cca96bf950bcd9586ab04f0e0f2b5d9a556c5e0.zip
* Merged changes from trunk [14688:14739/trunk].
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/renewal@14740 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r--src/map/itemdb.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index bf801fefd..92fe757c8 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -703,6 +703,32 @@ static bool itemdb_read_stack(char* fields[], int columns, int current)
return true;
}
+/// Reads items allowed to be sold in buying stores
+static bool itemdb_read_buyingstore(char* fields[], int columns, int current)
+{// <nameid>
+ int nameid;
+ struct item_data* id;
+
+ nameid = atoi(fields[0]);
+
+ if( ( id = itemdb_exists(nameid) ) == NULL )
+ {
+ ShowWarning("itemdb_read_buyingstore: Invalid item id %d.\n", nameid);
+ return false;
+ }
+
+ if( !itemdb_isstackable2(id) )
+ {
+ ShowWarning("itemdb_read_buyingstore: Non-stackable item id %d cannot be enabled for buying store.\n", nameid);
+ return false;
+ }
+
+ id->flag.buyingstore = true;
+
+ return true;
+}
+
+
/*======================================
* Applies gender restrictions according to settings. [Skotlex]
*======================================*/
@@ -1019,6 +1045,7 @@ static void itemdb_read(void)
sv_readdb(db_path, "item_noequip.txt", ',', 2, 2, -1, &itemdb_read_noequip);
sv_readdb(db_path, "item_trade.txt", ',', 3, 3, -1, &itemdb_read_itemtrade);
sv_readdb(db_path, "item_delay.txt", ',', 2, 2, MAX_ITEMDELAYS, &itemdb_read_itemdelay);
+ sv_readdb(db_path, "item_buyingstore.txt", ',', 1, 1, -1, &itemdb_read_buyingstore);
sv_readdb(db_path, "item_stack.txt", ',', 3, 3, -1, &itemdb_read_stack);
}