diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-21 16:18:19 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-21 16:18:19 +0000 |
commit | fac344b62ebbf48e7b1d2a7b5f0bcdd3608bd4a7 (patch) | |
tree | 8cc8a0b1312414c79f2c2d6e3d1e455754be41ea /crawl-ref/source/delay.cc | |
parent | b2ea8143ccf52a2cacfa48d19ce2ea603ddaab5e (diff) | |
download | crawl-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/delay.cc')
-rw-r--r-- | crawl-ref/source/delay.cc | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index c20494879e..5d3fc4334f 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -278,8 +278,6 @@ bool is_being_butchered(const item_def &item) void handle_delay( void ) /***********************/ { - char str_pass[ ITEMNAME_SIZE ]; - if (!you_are_delayed()) return; @@ -373,16 +371,12 @@ void handle_delay( void ) switch ( delay.type ) { case DELAY_ARMOUR_ON: - in_name( delay.parm1, DESC_NOCAP_YOUR, str_pass ); - snprintf( info, INFO_SIZE, - "You continue putting on %s.", str_pass ); - mpr(info, MSGCH_MULTITURN_ACTION); + mprf(MSGCH_MULTITURN_ACTION, "You continue putting on %s.", + you.inv[delay.parm1].name(DESC_NOCAP_YOUR).c_str()); break; case DELAY_ARMOUR_OFF: - in_name( delay.parm1, DESC_NOCAP_YOUR, str_pass ); - snprintf( info, INFO_SIZE, - "You continue taking off %s.", str_pass ); - mpr(info, MSGCH_MULTITURN_ACTION); + mprf(MSGCH_MULTITURN_ACTION, "You continue taking off %s.", + you.inv[delay.parm1].name(DESC_NOCAP_YOUR).c_str()); break; case DELAY_BUTCHER: mpr("You continue butchering the corpse.", @@ -413,7 +407,6 @@ void handle_delay( void ) static void finish_delay(const delay_queue_item &delay) { - char str_pass[ ITEMNAME_SIZE ]; switch (delay.type) { case DELAY_WEAPON_SWAP: @@ -430,9 +423,8 @@ static void finish_delay(const delay_queue_item &delay) case DELAY_ARMOUR_OFF: { - in_name( delay.parm1, DESC_NOCAP_YOUR, str_pass ); - snprintf( info, INFO_SIZE, "You finish taking off %s.", str_pass ); - mpr(info); + mprf("You finish taking off %s.", + you.inv[delay.parm1].name(DESC_NOCAP_YOUR).c_str()); const equipment_type slot = get_armour_slot( you.inv[delay.parm1] ); @@ -585,10 +577,9 @@ static void finish_delay(const delay_queue_item &delay) } else { - quant_name( you.inv[ delay.parm1 ], delay.parm2, - DESC_NOCAP_A, str_pass ); - - snprintf( info, INFO_SIZE, "You drop %s.", str_pass ); + snprintf( info, INFO_SIZE, "You drop %s.", + quant_name(you.inv[delay.parm1], delay.parm2, + DESC_NOCAP_A).c_str()); mpr(info); dec_inv_item_quantity( delay.parm1, delay.parm2 ); @@ -626,7 +617,7 @@ static void armour_wear_effects(const int item_slot) item_def &arm = you.inv[item_slot]; set_ident_flags(arm, ISFLAG_EQ_ARMOUR_MASK ); - mprf("You finish putting on %s.", item_name(arm, DESC_NOCAP_YOUR)); + mprf("You finish putting on %s.", arm.name(DESC_NOCAP_YOUR).c_str()); const equipment_type eq_slot = get_armour_slot(arm); |