monsters to cancel their teleportation without meaning to. (BR 2000428) Fix the quiver not being cleared when wielding the only quiverable (and thus previously quivered) item. (Un)wielding such an item now switches nicely between "Nothing wielded" and "Nothing quivered", as it should be.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6089 c06c8d41-db1a-0410-9941-cceddc491573
VNSLOK372XJJSBJRVPCEFXCXSGYBOUAEBWGNG2KEK6XRZI6GTK6AC 4GYZYBY7FFORRNPIEFTV4ZM2C7Z6D2KTQOM537ZCC2YBXT2TNSHAC ENI6P5WUO7DS4Y7EUDCYB4PSNT7CXH2L5JIB5BLZHNMWN4QDXMWQC COLMJH3UIQFF4R5AV642OJK4HHGUIIPLNP5WGKLWWYNJV7ZGPI7AC TK2BJDNDUF2XVLLLSGFXTK3ESZOQ6GGJC3UXENOCMEQXC4AE6T6AC LDBTCT5WIPLJPZWXS2RUQ26QKISCUUTLO77M464WOE6VSYSNPKYAC U6OTXM3JN7SGPVIGQ5F6NR2I7J5V7KOWFQ7AVNNRQQDNLBEDMYFQC 542UIZKI65UDRNEMGFFDBWYD5XC7AYLTZ3JZQRR2GHYJALD3YY6QC 5FBOE2QNRLKUNOP54CZD6LFAMM7LX6NNLHJRJHRDDIUTQ7J723DQC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC PFEJ4LMDNEKLMGRCMWQ7EIRVU4JMYGICI4G7X4WVWOROVXQCBZ7QC DDU4A3JGN5IUIPP5IASOODKPR2WBHSDSV4FITZ6HNXNSXXQACWAQC 4UXFU3FZOCBSLDQ4S7MJKAE2H7VUHCNRDQMIY6NJ3PHYXWNGISDQC X5WLJCJVW55SXZVP7IKP7ADCJIGNKN4PKAXFECVR6TNK7XSMZR7QC RPGERJQMO2J4ZDYTRHJCLZMXDVSTUOOJURSZ7FPWOUFHTXIV5VIAC if (! is_valid_item(m_last_used_of_type[slot]))
#ifdef DEBUG_QUIVERmprf(MSGCH_DIAGNOSTICS, "last quiver item: %s; link %d, wpn: %d",m_last_used_of_type[slot].name(DESC_PLAIN).c_str(),m_last_used_of_type[slot].link, you.equip[EQ_WEAPON]);#endifbool unquiver_weapon = false;if (is_valid_item(m_last_used_of_type[slot]))
// const launch_retval desired_ret =// (weapon && is_range_weapon(*weapon)) ? LRET_LAUNCHED : LRET_THROWN;const launch_retval desired_ret =(slot == AMMO_THROW ? LRET_THROWN : LRET_LAUNCHED);std::vector<int> order; _get_fire_order(order, false, weapon);
// If we're wielding an item previously quivered, the quiver may need// to be cleared. Else, any already quivered item is valid and we// don't need to do anything else.if (m_last_used_of_type[slot].link == you.equip[EQ_WEAPON])unquiver_weapon = true;elsereturn;}#ifdef DEBUG_QUIVERmpr("recalculating fire order...", MSGCH_DIAGNOSTICS);#endif// const launch_retval desired_ret =// (weapon && is_range_weapon(*weapon)) ? LRET_LAUNCHED : LRET_THROWN;const launch_retval desired_ret =(slot == AMMO_THROW ? LRET_THROWN : LRET_LAUNCHED);std::vector<int> order; _get_fire_order(order, false, weapon);if (unquiver_weapon && order.empty()){// m_last_used_of_type[slot] = you.inv[order[i]];m_last_used_of_type[slot].quantity = 0;}else{
for (int i_inv=inv_start; i_inv<ENDOFPACK; i_inv++)if (is_valid_item(you.inv[i_inv]) && you.inv[i_inv].launched_by(*launcher))
{for (int i_inv = inv_start; i_inv < ENDOFPACK; i_inv++)if (is_valid_item(you.inv[i_inv])&& you.inv[i_inv].launched_by(*launcher)){
case SPELL_TELEPORT_SELF:case SPELL_BLINK:return true;default:return false;
case SPELL_TELEPORT_SELF:// Don't cast again if already about to teleport.if (mon->has_ench(ENCH_TP))return (false);// intentional fall-throughcase SPELL_BLINK:return (true);default:return (false);