game: try to update the healing shop's items when the pc switches...

This commit is contained in:
ALONSO Laurent
2022-01-12 12:02:26 +01:00
committed by Celtic Minstrel
parent ba08e03be0
commit 59183073b3
2 changed files with 2 additions and 1 deletions

View File

@@ -732,6 +732,7 @@ static void handle_switch_pc(short which_pc, bool& need_redraw, bool& need_repri
univ.cur_pc = which_pc; univ.cur_pc = which_pc;
set_stat_window_for_pc(which_pc); set_stat_window_for_pc(which_pc);
add_string_to_buf("Now " + std::string(overall_mode == MODE_SHOPPING ? "shopping" : "active") + ": " + pc.name); add_string_to_buf("Now " + std::string(overall_mode == MODE_SHOPPING ? "shopping" : "active") + ": " + pc.name);
if (overall_mode==MODE_SHOPPING) set_up_shop_array(); // needed to be sure healing is updated
adjust_spell_menus(); adjust_spell_menus();
need_redraw = true; need_redraw = true;
} }

View File

@@ -302,7 +302,7 @@ int cCreature::magic_adjust(int how_much) {
if(how_much <= 0) return how_much; if(how_much <= 0) return how_much;
if(abil[eMonstAbil::ABSORB_SPELLS].active && get_ran(1,1,1000) <= abil[eMonstAbil::ABSORB_SPELLS].special.extra1) { if(abil[eMonstAbil::ABSORB_SPELLS].active && get_ran(1,1,1000) <= abil[eMonstAbil::ABSORB_SPELLS].special.extra1) {
int gain = abil[eMonstAbil::ABSORB_SPELLS].special.extra2; int gain = abil[eMonstAbil::ABSORB_SPELLS].special.extra2;
if(32767 - health > gain) if(32767 - int(health) > gain)
health = 32767; health = 32767;
else health += gain; else health += gain;
return 0; return 0;