Skip to content

Commit

Permalink
guard next_action_type() call
Browse files Browse the repository at this point in the history
  • Loading branch information
NQNStudios authored and CelticMinstrel committed Aug 8, 2024
1 parent f549317 commit a1022aa
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/dialogxml/dialogs/dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,14 +536,12 @@ void cDialog::handle_events() {
cFramerateLimiter fps_limiter;

while(dialogNotToast) {
if(replaying){
if(next_action_type() == "control_click"){
Element& next_action = pop_next_action();
auto info = info_from_action(next_action);
if(info["id"].empty()) continue;
eKeyMod mods = static_cast<eKeyMod>(atoi(info["mods"].c_str()));
controls[info["id"]]->triggerClickHandler(*this, info["id"], mods);
}
if(replaying && has_next_action() && next_action_type() == "control_click"){
Element& next_action = pop_next_action();
auto info = info_from_action(next_action);
if(info["id"].empty()) continue;
eKeyMod mods = static_cast<eKeyMod>(atoi(info["mods"].c_str()));
controls[info["id"]]->triggerClickHandler(*this, info["id"], mods);
}else{
while(win.pollEvent(currentEvent)) handle_one_event(currentEvent);
}
Expand Down

0 comments on commit a1022aa

Please sign in to comment.