s64b_mul(&new_exp, &new_exp_frac, 0, r_ptr->mexp);
/* Gain experience */
- gain_exp_64(new_exp, new_exp_frac);
+ gain_exp_64(p_ptr, new_exp, new_exp_frac);
}
/*
* Gain experience
*/
-void gain_exp_64(s32b amount, u32b amount_frac)
+void gain_exp_64(player_type *creature_ptr, s32b amount, u32b amount_frac)
{
- if (p_ptr->is_dead) return;
+ if (creature_ptr->is_dead) return;
- if (p_ptr->prace == RACE_ANDROID) return;
+ if (creature_ptr->prace == RACE_ANDROID) return;
/* Gain some experience */
- s64b_add(&(p_ptr->exp), &(p_ptr->exp_frac), amount, amount_frac);
+ s64b_add(&(creature_ptr->exp), &(creature_ptr->exp_frac), amount, amount_frac);
/* Slowly recover from experience drainage */
- if (p_ptr->exp < p_ptr->max_exp)
+ if (creature_ptr->exp < creature_ptr->max_exp)
{
/* Gain max experience (20%) (was 10%) */
- p_ptr->max_exp += amount / 5;
+ creature_ptr->max_exp += amount / 5;
}
/* Check Experience */
*/
void gain_exp(player_type *creature_ptr, s32b amount)
{
- gain_exp_64(amount, 0L);
+ gain_exp_64(creature_ptr, amount, 0L);
}
extern bool do_inc_stat(player_type *creature_ptr, int stat);
extern bool restore_level(player_type *creature_ptr);
extern bool lose_all_info(player_type *creature_ptr);
-extern void gain_exp_64(s32b amount, u32b amount_frac);
+extern void gain_exp_64(player_type *creature_ptr, s32b amount, u32b amount_frac);
extern void gain_exp(player_type *creature_ptr, s32b amount);
extern void calc_android_exp(player_type *creature_ptr);
extern void lose_exp(player_type *creature_ptr, s32b amount);