summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWushin <pasekei@gmail.com>2015-05-11 20:51:07 -0500
committerWushin <pasekei@gmail.com>2015-05-11 20:51:07 -0500
commitda02d3d622cc24384284952798b5a9c6e3e386d5 (patch)
tree9c4e1c9bcfa9fd558efa9741da0bb87015d41c8c
parent784ca0b6ec91ecd66019ea915e897ecca4adbed0 (diff)
parentf9f245a109bff84a030f917122eeb9b6336a982c (diff)
downloadtmwa-da02d3d622cc24384284952798b5a9c6e3e386d5.tar.gz
tmwa-da02d3d622cc24384284952798b5a9c6e3e386d5.tar.bz2
tmwa-da02d3d622cc24384284952798b5a9c6e3e386d5.tar.xz
tmwa-da02d3d622cc24384284952798b5a9c6e3e386d5.zip
Merge pull request #69 from mekolat/getitemlink
remove item labels
-rw-r--r--src/ast/item.cpp1
-rw-r--r--src/ast/item.hpp1
-rw-r--r--src/ast/item_test.cpp8
-rw-r--r--src/map/atcommand.cpp12
-rw-r--r--src/map/itemdb.cpp1
-rw-r--r--src/map/itemdb.hpp2
-rw-r--r--src/map/script-fun.cpp69
7 files changed, 10 insertions, 84 deletions
diff --git a/src/ast/item.cpp b/src/ast/item.cpp
index bd4f295..d27e231 100644
--- a/src/ast/item.cpp
+++ b/src/ast/item.cpp
@@ -128,7 +128,6 @@ namespace item
Item item;
SPAN_EXTRACT(first, item.id);
SPAN_EXTRACT(TRY_UNWRAP(lex_nonscript(lr, false), return EOL_ERROR(lr)), item.name);
- SPAN_EXTRACT(TRY_UNWRAP(lex_nonscript(lr, false), return EOL_ERROR(lr)), item.jname);
SPAN_EXTRACT(TRY_UNWRAP(lex_nonscript(lr, false), return EOL_ERROR(lr)), item.type);
SPAN_EXTRACT(TRY_UNWRAP(lex_nonscript(lr, false), return EOL_ERROR(lr)), item.buy_price);
SPAN_EXTRACT(TRY_UNWRAP(lex_nonscript(lr, false), return EOL_ERROR(lr)), item.sell_price);
diff --git a/src/ast/item.hpp b/src/ast/item.hpp
index a8fe908..c772655 100644
--- a/src/ast/item.hpp
+++ b/src/ast/item.hpp
@@ -49,7 +49,6 @@ namespace item
{
Spanned<ItemNameId> id;
Spanned<ItemName> name;
- Spanned<ItemName> jname;
Spanned<ItemType> type;
Spanned<int> buy_price;
Spanned<int> sell_price;
diff --git a/src/ast/item_test.cpp b/src/ast/item_test.cpp
index a77662e..6e2cee7 100644
--- a/src/ast/item_test.cpp
+++ b/src/ast/item_test.cpp
@@ -89,9 +89,9 @@ namespace item
{
// 1 2 3 4 5
//2345678901234567890123456789012345678901234567890123456789
- "1,abc , def,3,4,5,6,7,8,9,10,xx,2,16,12,13,11, {end;}, {}"_s,
- "1,abc , def,3,4,5,6,7,8,9,10,xx,2,16,12,13,11, {end;}, {}\n"_s,
- "1,abc , def,3,4,5,6,7,8,9,10,xx,2,16,12,13,11, {end;}, {}\nabc"_s,
+ "1,abc , 3,4,5,6,7,8,9,10,xx,2,16,12,13,11, {end;}, {}"_s,
+ "1,abc , 3,4,5,6,7,8,9,10,xx,2,16,12,13,11, {end;}, {}\n"_s,
+ "1,abc , 3,4,5,6,7,8,9,10,xx,2,16,12,13,11, {end;}, {}\nabc"_s,
};
for (auto input : inputs)
{
@@ -108,8 +108,6 @@ namespace item
EXPECT_EQ(p->id.data, wrap<ItemNameId>(1));
EXPECT_SPAN(p->name.span, 1,3, 1,6);
EXPECT_EQ(p->name.data, stringish<ItemName>("abc "_s));
- EXPECT_SPAN(p->jname.span, 1,10, 1,12);
- EXPECT_EQ(p->jname.data, stringish<ItemName>("def"_s));
EXPECT_SPAN(p->type.span, 1,14, 1,14);
EXPECT_EQ(p->type.data, ItemType::JUNK);
EXPECT_SPAN(p->buy_price.span, 1,16, 1,16);
diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp
index 7739966..46d857d 100644
--- a/src/map/atcommand.cpp
+++ b/src/map/atcommand.cpp
@@ -3037,10 +3037,10 @@ ATCE atcommand_idsearch(Session *s, dumb_ptr<map_session_data>,
for (ItemNameId i = wrap<ItemNameId>(0); i < wrap<ItemNameId>(-1); i = next(i))
{
P<struct item_data> item = TRY_UNWRAP(itemdb_exists(i), continue);
- if (item->jname.contains_seq(item_name))
+ if (item->name.contains_seq(item_name))
{
match++;
- output = STRPRINTF("%s: %d"_fmt, item->jname, item->nameid);
+ output = STRPRINTF("%s: %d"_fmt, item->name, item->nameid);
clif_displaymessage(s, output);
}
}
@@ -3975,9 +3975,9 @@ ATCE atcommand_character_item_list(Session *s, dumb_ptr<map_session_data> sd,
AString output;
if (true)
- output = STRPRINTF("%d %s (%s, id: %d) %s"_fmt,
+ output = STRPRINTF("%d %s (id: %d) %s"_fmt,
pl_sd->status.inventory[i].amount,
- item_data->name, item_data->jname,
+ item_data->name,
pl_sd->status.inventory[i].nameid,
AString(equipstr));
clif_displaymessage(s, output);
@@ -4051,9 +4051,9 @@ ATCE atcommand_character_storage_list(Session *s, dumb_ptr<map_session_data> sd,
}
AString output;
if (true)
- output = STRPRINTF("%d %s (%s, id: %d)"_fmt,
+ output = STRPRINTF("%d %s (id: %d)"_fmt,
stor->storage_[i].amount,
- item_data->name, item_data->jname,
+ item_data->name,
stor->storage_[i].nameid);
clif_displaymessage(s, output);
}
diff --git a/src/map/itemdb.cpp b/src/map/itemdb.cpp
index 7dd725e..7b23503 100644
--- a/src/map/itemdb.cpp
+++ b/src/map/itemdb.cpp
@@ -188,7 +188,6 @@ bool itemdb_readdb(ZString filename)
item_data idv {};
idv.nameid = item.id.data;
idv.name = item.name.data;
- idv.jname = item.jname.data;
idv.type = item.type.data;
idv.value_buy = item.buy_price.data ?: item.sell_price.data * 2;
idv.value_sell = item.sell_price.data ?: item.buy_price.data / 2;
diff --git a/src/map/itemdb.hpp b/src/map/itemdb.hpp
index 5e19c0b..19f40a8 100644
--- a/src/map/itemdb.hpp
+++ b/src/map/itemdb.hpp
@@ -36,7 +36,7 @@ namespace map
struct item_data
{
ItemNameId nameid;
- ItemName name, jname;
+ ItemName name;
int value_buy;
int value_sell;
ItemType type;
diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp
index 4c20555..744f2c3 100644
--- a/src/map/script-fun.cpp
+++ b/src/map/script-fun.cpp
@@ -1124,45 +1124,6 @@ void builtin_freeloop(ScriptState *st)
}
/*==========================================
- * 装備名文字列(精錬メニュー用)
- *------------------------------------------
- */
-static
-void builtin_getequipname(ScriptState *st)
-{
- int num;
- dumb_ptr<map_session_data> sd;
-
- AString buf;
-
- sd = script_rid2sd(st);
- num = conv_num(st, &AARG(0));
- IOff0 i = pc_checkequip(sd, equip[num - 1]);
- if (i.ok())
- {
- Option<P<struct item_data>> item_ = sd->inventory_data[i];
- OMATCH_BEGIN (item_)
- {
- OMATCH_CASE_SOME (item)
- {
- buf = STRPRINTF("%s-[%s]"_fmt, pos_str[num - 1], item->jname);
- }
- OMATCH_CASE_NONE ()
- {
- buf = STRPRINTF("%s-[%s]"_fmt, pos_str[num - 1], pos_str[10]);
- }
- }
- OMATCH_END ();
- }
- else
- {
- buf = STRPRINTF("%s-[%s]"_fmt, pos_str[num - 1], pos_str[10]);
- }
- push_str<ScriptDataStr>(st->stack, buf);
-
-}
-
-/*==========================================
* 装備品による能力値ボーナス
*------------------------------------------
*/
@@ -2258,34 +2219,6 @@ void builtin_divorce(ScriptState *st)
push_int<ScriptDataInt>(st->stack, 1);
}
-/*==========================================
- * IDからItem名
- *------------------------------------------
- */
-static
-void builtin_getitemname(ScriptState *st)
-{
- Option<P<struct item_data>> i_data = None;
- struct script_data *data;
-
- data = &AARG(0);
- get_val(st, data);
- if (data->is<ScriptDataStr>())
- {
- ZString name = ZString(conv_str(st, data));
- i_data = itemdb_searchname(name);
- }
- else
- {
- ItemNameId item_id = wrap<ItemNameId>(conv_num(st, data));
- i_data = Some(itemdb_search(item_id));
- }
-
- RString item_name = i_data.pmd_pget(&item_data::jname).copy_or(stringish<ItemName>("Unknown Item"_s));
-
- push_str<ScriptDataStr>(st->stack, item_name);
-}
-
static
void builtin_getitemlink(ScriptState *st)
{
@@ -3097,7 +3030,6 @@ BuiltinFunction builtin_functions[] =
BUILTIN(getcharid, "i?"_s, 'i'),
BUILTIN(strcharinfo, "i"_s, 's'),
BUILTIN(getequipid, "i"_s, 'i'),
- BUILTIN(getequipname, "i"_s, 's'),
BUILTIN(bonus, "ii"_s, '\0'),
BUILTIN(bonus2, "iii"_s, '\0'),
BUILTIN(skill, "ii?"_s, '\0'),
@@ -3152,7 +3084,6 @@ BuiltinFunction builtin_functions[] =
BUILTIN(mobcount, "ME"_s, 'i'),
BUILTIN(marriage, "P"_s, 'i'),
BUILTIN(divorce, ""_s, 'i'),
- BUILTIN(getitemname, "I"_s, 's'),
BUILTIN(getitemlink, "I"_s, 's'),
BUILTIN(getspellinvocation, "s"_s, 's'),
BUILTIN(getpartnerid2, ""_s, 'i'),