to false. If rest_wait_both is true then resting will only stop when both HP and MP are both fully restored, not when only one or the other is restored. If chunks_autopickup is true then flesh chunks generated from butchering will automatically be picked up (respecting the other autopickup settings).
My implementation of rest_wait_both has a few side effects. I got rid of check_hp() and check_mp() from the runrest class, since player AI interruption code seems to be able to take care of that. I also added a rather kuldgey block_interruptions() so that the activity interrupts code could use mpr() without going into infinite recursion because of AI_MESSAGE interrutps.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5337 c06c8d41-db1a-0410-9941-cceddc491573
4TPFZIL52CS4HPO5LQMKS3PHTE2X2C547ULEFXKM4UIQQ64FUBGAC
HAPVR5GF5W5ACZPKXFEK2GSRHCPEZO2TIESOO7PWMOTQETCBISPQC
UET576SVCGS2TXEDRTO7BUTOTLJ77MYHIVZJCDWGH2BAXYMKG6DAC
HIPFIMUOA7DFOFV3DQ55YZJVGNU2GNDYFUCB4MRPUR5DTYDO5YMAC
PLJI4CMQZJ773B3QFPKBM3NBDHOMKTR63TRI7IRC67LHFNOQNUHQC
H3EEUJYQCVEXQSDP62GBIC47T4BKBAC4Z65HRKGJK2M5MFXZWYOAC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC
3WRAJZ5ZLOSIZHFBUH5552QC4F3GAK7AXF6VIQFVN6VY7PUO6HPQC
ZM4IOCU4Y3NUKTLW3KPBCPWQD4NJ6BCORCVSOBJWXL5Z7H3QBPSAC
LDBTCT5WIPLJPZWXS2RUQ26QKISCUUTLO77M464WOE6VSYSNPKYAC
IPXXB4VRVZWOU5DKQ5ZTD37LS3QNK2R6APNZUO672YEEJT6OFAYQC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
O2GH2BHUL4XXIIJSMKNV2NIC4KQACE6HLMUL4KEUDFNFEAGMZSZAC
BFYHDL4EHSPKKC6EPKDRPESHYAA2WFKC6RXQIRRTSSTF3Z2QPVCAC
IXW2IM5ITYDCXDB3ORDDVAR5XUSPVQ3BWLP3Q6TRXNTIKGMZTHXAC
CYAVI4PYWMMKTPYT5N2B3MI4OSHZFLPKOZFSLFJUXRYAACYXWW3AC
JM7UAK777RAVDAVLQLEOBRTGNW2B47S5G55XITJXO243IUNZHVYQC
Q3XHNSHW6FI4JCXSEABATRFBJPMCF7PXNG2K6ZQTRRPVMIZFHUBQC
5R4WV4H5SNIM5WU2X33JJ63HIEGKCXN2HELZ6FRRKKANPLMRLF3QC
5HPIIGNWB3UXJ5APQLAGFOV2CA7J2GB7AWAVVZDBB2YZS4TNCMAQC
YL67KHG3TAZXJCWGRZPVASD6RS2SQ3V5KMIUK4E6PV43V2NBOLEAC
WL5WZXFJ6TONUQRSHUY4GQ5USU47ILWNN5X2JDQZO4CRJJZSRQIAC
EHSY6DVGUMI6C67WKET3GDJVLWJWGYBYQONNDK5JVT7BCTHBEZVAC
EOMCPVNQLX3IMLC46EAO67DPBH5KEG2FQTPBLGU62HIRWA3UQ7XQC
RVST2QHYJ757ZHK4AUJ5NGPDZ44AD6RVFVXYPKQIBJXZBDNUCHXQC
}
void runrest::check_hp()
{
if (is_rest() && you.hp == you.hp_max && you.hp > hp)
{
mpr("HP restored.");
stop();
}
void runrest::check_mp()
{
if (is_rest() && you.magic_points == you.max_magic_points
&& you.magic_points > mp)
{
mpr("Magic restored.");
stop();
}
}
else if (ai == AI_SEE_MONSTER && (curr == DELAY_ASCENDING_STAIRS ||
curr == DELAY_DESCENDING_STAIRS))
return false;
if (ai == AI_FULL_HP || ai == AI_FULL_MP)
{
// No recursive interruptions from messages (AI_MESSAGE)
block_interruptions(true);
if (ai == AI_FULL_HP)
mpr("HP restored.");
else
mpr("Magic restored.");
block_interruptions(false);
if (Options.rest_wait_both && curr == DELAY_REST
&& (you.magic_points < you.max_magic_points
|| you.hp < you.hp_max))
{
return false;
}
}