From 69734d42b1f797775be72463efb8eca69edf5d4f Mon Sep 17 00:00:00 2001 From: mekolat Date: Thu, 23 Apr 2015 23:37:14 -0400 Subject: remove builtin getitemname --- src/map/script-fun.cpp | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'src') diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index 010b095..62407a5 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -2245,34 +2245,6 @@ void builtin_divorce(ScriptState *st) push_int(st->stack, 1); } -/*========================================== - * IDからItem名 - *------------------------------------------ - */ -static -void builtin_getitemname(ScriptState *st) -{ - Option> i_data = None; - struct script_data *data; - - data = &AARG(0); - get_val(st, data); - if (data->is()) - { - ZString name = ZString(conv_str(st, data)); - i_data = itemdb_searchname(name); - } - else - { - ItemNameId item_id = wrap(conv_num(st, data)); - i_data = Some(itemdb_search(item_id)); - } - - RString item_name = i_data.pmd_pget(&item_data::jname).copy_or(stringish("Unknown Item"_s)); - - push_str(st->stack, item_name); -} - static void builtin_getitemlink(ScriptState *st) { @@ -3139,7 +3111,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'), -- cgit v1.2.3-70-g09d2 From 543924caa81c3469a90388e5112dcd93abf6eec9 Mon Sep 17 00:00:00 2001 From: mekolat Date: Fri, 24 Apr 2015 00:30:40 -0400 Subject: remove deprecated getequipname builtin --- src/map/script-fun.cpp | 40 ---------------------------------------- 1 file changed, 40 deletions(-) (limited to 'src') diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index 62407a5..8aae552 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -1118,45 +1118,6 @@ void builtin_freeloop(ScriptState *st) } } -/*========================================== - * 装備名文字列(精錬メニュー用) - *------------------------------------------ - */ -static -void builtin_getequipname(ScriptState *st) -{ - int num; - dumb_ptr 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> 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(st->stack, buf); - -} - /*========================================== * 装備品による能力値ボーナス *------------------------------------------ @@ -3056,7 +3017,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'), -- cgit v1.2.3-70-g09d2 From f9f245a109bff84a030f917122eeb9b6336a982c Mon Sep 17 00:00:00 2001 From: mekolat Date: Fri, 24 Apr 2015 00:25:18 -0400 Subject: remove item labels --- src/ast/item.cpp | 1 - src/ast/item.hpp | 1 - src/ast/item_test.cpp | 8 +++----- src/map/atcommand.cpp | 12 ++++++------ src/map/itemdb.cpp | 1 - src/map/itemdb.hpp | 2 +- 6 files changed, 10 insertions(+), 15 deletions(-) (limited to 'src') 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 id; Spanned name; - Spanned jname; Spanned type; Spanned buy_price; Spanned 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(1)); EXPECT_SPAN(p->name.span, 1,3, 1,6); EXPECT_EQ(p->name.data, stringish("abc "_s)); - EXPECT_SPAN(p->jname.span, 1,10, 1,12); - EXPECT_EQ(p->jname.data, stringish("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, for (ItemNameId i = wrap(0); i < wrap(-1); i = next(i)) { P 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 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 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; -- cgit v1.2.3-70-g09d2