fix more advance_time cases

This commit is contained in:
2024-09-25 11:57:33 -05:00
committed by Celtic Minstrel
parent 7c4e8023b1
commit a21b44c238
3 changed files with 17 additions and 14 deletions

View File

@@ -1253,7 +1253,7 @@ void screen_shift(int dx, int dy, bool& need_redraw) {
need_redraw = true;
}
void handle_print_pc_hp(int which_pc) {
void handle_print_pc_hp(int which_pc, bool& need_reprint) {
if(recording){
record_action("handle_print_pc_hp", boost::lexical_cast<std::string>(which_pc));
}
@@ -1262,9 +1262,10 @@ void handle_print_pc_hp(int which_pc) {
str << pc.name << " has ";
str << pc.cur_health << " health out of " << pc.max_health << '.';
add_string_to_buf(str.str());
need_reprint = true;
}
void handle_print_pc_sp(int which_pc) {
void handle_print_pc_sp(int which_pc, bool& need_reprint) {
if(recording){
record_action("handle_print_pc_sp", boost::lexical_cast<std::string>(which_pc));
}
@@ -1273,9 +1274,10 @@ void handle_print_pc_sp(int which_pc) {
str << pc.name << " has ";
str << pc.cur_sp << " spell pts. out of " << pc.max_sp << '.';
add_string_to_buf(str.str());
need_reprint = true;
}
void handle_trade_places(int which_pc) {
void handle_trade_places(int which_pc, bool& need_reprint) {
if(recording){
record_action("handle_trade_places", boost::lexical_cast<std::string>(which_pc));
}
@@ -1286,6 +1288,7 @@ void handle_trade_places(int which_pc) {
else {
switch_pc(which_pc);
}
need_reprint = true;
}
void show_item_info(short item_hit) {
@@ -1533,22 +1536,22 @@ bool handle_action(const sf::Event& event, cFramerateLimiter& fps_limiter) {
handle_switch_pc(i, need_redraw, need_reprint);
break;
case PCBTN_HP:
handle_print_pc_hp(i);
handle_print_pc_hp(i, need_reprint);
break;
case PCBTN_SP:
handle_print_pc_sp(i);
handle_print_pc_sp(i, need_reprint);
break;
case PCBTN_INFO:
give_pc_info(i);
break;
// don't call advance_time
return false;
case PCBTN_TRADE:
handle_trade_places(i);
handle_trade_places(i, need_reprint);
break;
case MAX_ePlayerButton:
break; // Not a button
}
}
need_reprint = true;
put_pc_screen();
put_item_screen(stat_window);
if(overall_mode == MODE_SHOPPING) {

View File

@@ -91,9 +91,9 @@ void debug_increase_age();
void debug_towns_forget();
void debug_heal_plus_extra();
void debug_heal();
void handle_print_pc_hp(int which_pc);
void handle_print_pc_sp(int which_pc);
void handle_trade_places(int which_pc);
void handle_print_pc_hp(int which_pc, bool& need_reprint);
void handle_print_pc_sp(int which_pc, bool& need_reprint);
void handle_trade_places(int which_pc, bool& need_reprint);
void handle_begin_talk(bool& need_reprint);
void handle_talk(location destination, bool& did_something, bool& need_redraw, bool& need_reprint);
void give_help_and_record(short help1, short help2);

View File

@@ -551,14 +551,14 @@ static void replay_next_action() {
debug_heal_plus_extra();
return;
}else if(t == "handle_print_pc_hp"){
handle_print_pc_hp(boost::lexical_cast<int>(next_action.GetText()));
handle_print_pc_hp(boost::lexical_cast<int>(next_action.GetText()), need_reprint);
}else if(t == "handle_print_pc_sp"){
handle_print_pc_sp(boost::lexical_cast<int>(next_action.GetText()));
handle_print_pc_sp(boost::lexical_cast<int>(next_action.GetText()), need_reprint);
}else if(t == "give_pc_info"){
give_pc_info(boost::lexical_cast<short>(next_action.GetText()));
return;
}else if(t == "handle_trade_places"){
handle_trade_places(boost::lexical_cast<short>(next_action.GetText()));
handle_trade_places(boost::lexical_cast<short>(next_action.GetText()), need_reprint);
}else if(t == "handle_begin_talk"){
handle_begin_talk(need_reprint);
}else if(t == "handle_talk"){