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(-) 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-60-g2f50