The cause of the crash was that the active_menu_ variable was set to UNIT_FACING after the unit facing setting is finished. When clicking the menu it was looking for a unit because of the value of the active_menu_ variable and on line 670 the assert failed because it could not find one. Setting active_menu_ to MAP after the unit facing is set fixes this.

This commit is contained in:
SomeName42 2024-10-05 13:45:09 +02:00 committed by Pentarctagon
parent 4e1666c7a1
commit a5e17f770d

View file

@ -770,6 +770,7 @@ bool editor_controller::do_execute_command(const hotkey::ui_command& cmd, bool p
assert(un != get_current_map_context().units().end());
un->set_facing(map_location::direction(index));
un->anim_comp().set_standing();
active_menu_ = MAP;
return true;
}
}