summaryrefslogtreecommitdiff
path: root/src/xtra1.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2016-09-17 09:58:15 +0200
committerBardur Arantsson <bardur@scientician.net>2016-09-17 09:58:15 +0200
commitb85a1f777946af3ba763942ee78a7a4bce2afdb0 (patch)
treef4b41468e525dcf78e9d7ed0df56cf344c87ad36 /src/xtra1.cc
parent8bf363159104aa0c87d8021e731022c41df8037f (diff)
Move player_hp[] into Game
Diffstat (limited to 'src/xtra1.cc')
-rw-r--r--src/xtra1.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/xtra1.cc b/src/xtra1.cc
index c8fdb2e0..b4f2adf6 100644
--- a/src/xtra1.cc
+++ b/src/xtra1.cc
@@ -1841,15 +1841,13 @@ static void calc_mana(void)
*/
void calc_hitpoints(void)
{
- int bonus, mhp;
+ auto const &player_hp = game->player_hp;
/* Un-inflate "half-hitpoint bonus per level" value */
- bonus = ((int)(adj_con_mhp[p_ptr->stat_ind[A_CON]]) - 128);
+ int const bonus = ((int)(adj_con_mhp[p_ptr->stat_ind[A_CON]]) - 128);
/* Calculate hitpoints */
- assert(p_ptr->lev - 1 >= 0);
- assert(p_ptr->lev - 1 < PY_MAX_LEVEL);
- mhp = player_hp[p_ptr->lev - 1] + (bonus * p_ptr->lev / 2);
+ int mhp = player_hp[p_ptr->lev - 1] + (bonus * p_ptr->lev / 2);
/* Always have at least one hitpoint per level */
if (mhp < p_ptr->lev + 1) mhp = p_ptr->lev + 1;