summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/direct.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-21 16:18:19 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-21 16:18:19 +0000
commitfac344b62ebbf48e7b1d2a7b5f0bcdd3608bd4a7 (patch)
tree8cc8a0b1312414c79f2c2d6e3d1e455754be41ea /crawl-ref/source/direct.cc
parentb2ea8143ccf52a2cacfa48d19ce2ea603ddaab5e (diff)
downloadcrawl-ref-fac344b62ebbf48e7b1d2a7b5f0bcdd3608bd4a7.tar.gz
crawl-ref-fac344b62ebbf48e7b1d2a7b5f0bcdd3608bd4a7.zip
Eliminated it_name(), in_name(), item_name(). The function to use is
now item_def::name(). Cleaned up a lot of code in the process. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1341 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/direct.cc')
-rw-r--r--crawl-ref/source/direct.cc25
1 files changed, 10 insertions, 15 deletions
diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc
index d5b8bb8dbc..aeb942f947 100644
--- a/crawl-ref/source/direct.cc
+++ b/crawl-ref/source/direct.cc
@@ -1456,8 +1456,7 @@ static void describe_mons_enchantment(const monsters &mons,
static void describe_cell(int mx, int my)
{
- char str_pass[ ITEMNAME_SIZE ];
- bool mimic_item = false;
+ bool mimic_item = false;
if (mgrd[mx][my] != NON_MONSTER)
{
@@ -1485,21 +1484,18 @@ static void describe_cell(int mx, int my)
if (menv[i].type != MONS_DANCING_WEAPON && mon_wep != NON_ITEM)
{
- snprintf( info, INFO_SIZE, "%s is wielding ",
- mons_pronoun( menv[i].type, PRONOUN_CAP ));
- it_name(mon_wep, DESC_NOCAP_A, str_pass);
- strcat(info, str_pass);
+ snprintf( info, INFO_SIZE, "%s is wielding %s",
+ mons_pronoun( menv[i].type, PRONOUN_CAP ),
+ mitm[mon_wep].name(DESC_NOCAP_A).c_str());
// 2-headed ogres can wield 2 weapons
- if ((menv[i].type == MONS_TWO_HEADED_OGRE
- || menv[i].type == MONS_ETTIN)
+ if ((menv[i].type == MONS_TWO_HEADED_OGRE
+ || menv[i].type == MONS_ETTIN)
&& menv[i].inv[MSLOT_MISSILE] != NON_ITEM)
{
- strcat( info, " and " );
- it_name(menv[i].inv[MSLOT_MISSILE], DESC_NOCAP_A, str_pass);
- strcat(info, str_pass);
+ strcat(info, " and " );
+ strcat(info, mitm[menv[i].inv[MSLOT_MISSILE]].name(DESC_NOCAP_A).c_str());
strcat(info, ".");
-
mpr(info);
}
else
@@ -1512,8 +1508,7 @@ static void describe_cell(int mx, int my)
if (mon_arm != NON_ITEM)
mprf("%s is wearing %s.",
mons_pronoun(menv[i].type, PRONOUN_CAP),
- it_name(mon_arm, DESC_NOCAP_A, str_pass));
-
+ mitm[mon_arm].name(DESC_NOCAP_A).c_str());
if (menv[i].type == MONS_HYDRA)
mprf("It has %d head%s.", menv[i].number,
@@ -1590,7 +1585,7 @@ static void describe_cell(int mx, int my)
mprf( MSGCH_FLOOR_ITEMS, "A pile of gold coins." );
else
mprf( MSGCH_FLOOR_ITEMS, "You see %s here.",
- it_name(targ_item, DESC_NOCAP_A, str_pass));
+ mitm[targ_item].name(DESC_NOCAP_A).c_str());
if (mitm[ targ_item ].link != NON_ITEM)
mprf( MSGCH_FLOOR_ITEMS,