record and replay debug enter town

This commit is contained in:
2024-08-27 16:21:48 -05:00
committed by Celtic Minstrel
parent 42f66cf2d8
commit 1ce3d5045a
3 changed files with 16 additions and 6 deletions

View File

@@ -1879,6 +1879,18 @@ void debug_magic_map() {
print_buf();
}
void debug_enter_town() {
if(recording){
record_action("debug_enter_town", "");
}
short find_direction_from;
if(univ.party.direction == 0) find_direction_from = 2;
else if(univ.party.direction == 4) find_direction_from = 0;
else if(univ.party.direction < 4) find_direction_from = 3;
else find_direction_from = 1;
start_town_mode(get_num_response(0, univ.scenario.towns.size() - 1, "Enter Town Number"), find_direction_from);
}
bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
bool are_done = false;
location pass_point; // TODO: This isn't needed
@@ -2187,12 +2199,7 @@ bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
case 'T':
if(!univ.debug_mode) break;
short find_direction_from;
if(univ.party.direction == 0) find_direction_from = 2;
else if(univ.party.direction == 4) find_direction_from = 0;
else if(univ.party.direction < 4) find_direction_from = 3;
else find_direction_from = 1;
start_town_mode(get_num_response(0, univ.scenario.towns.size() - 1, "Enter Town Number"), find_direction_from);
debug_enter_town();
break;
case 'W':

View File

@@ -77,5 +77,6 @@ void debug_step_through();
void debug_leave_town();
void debug_kill();
void debug_magic_map();
void debug_enter_town();
#endif

View File

@@ -493,6 +493,8 @@ static void replay_next_action() {
debug_kill();
}else if(t == "debug_magic_map"){
debug_magic_map();
}else if(t == "debug_enter_town"){
debug_enter_town();
}
// TODO some of these actions shouldn't call advance_time(). They should return