summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2008-12-11 17:39:01 +0000
committerJared Adams <jaxad0127@gmail.com>2008-12-11 17:39:01 +0000
commit19a9355ec566fcab79f0039f496a420d79d29c80 (patch)
treeeb227b9f01980ab48c40df3820f9af17c0643d3a
parentc9e5567e98cf7e26c549f4a512eeece24a0d9c81 (diff)
downloadtmwa-19a9355ec566fcab79f0039f496a420d79d29c80.tar.gz
tmwa-19a9355ec566fcab79f0039f496a420d79d29c80.tar.bz2
tmwa-19a9355ec566fcab79f0039f496a420d79d29c80.tar.xz
tmwa-19a9355ec566fcab79f0039f496a420d79d29c80.zip
Fix ItemDB loading to use the correct buy/sell
-rw-r--r--src/map/itemdb.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 2c247bb..6105279 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -348,12 +348,13 @@ static int itemdb_readdb(void)
memcpy(id->jname,str[2],24);
id->type=atoi(str[3]);
// buy≠sell*2 は item_value_db.txt で指定してください。
- if (atoi(str[5])) { // sell値を優先とする
- id->value_buy=atoi(str[5])*2;
- id->value_sell=atoi(str[5]);
- } else {
- id->value_buy=atoi(str[4]);
- id->value_sell=atoi(str[4])/2;
+ id->value_buy=atoi(str[4]);
+ id->value_sell=atoi(str[5]);
+ if (id->value_buy == 0 && id->value_sell == 0) {
+ } else if (id->value_buy == 0) {
+ id->value_buy=id->value_sell*2;
+ } else if (id->value_sell == 0) {
+ id->value_sell=id->value_buy/2;
}
id->weight=atoi(str[6]);
id->atk=atoi(str[7]);