mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-13 10:50:35 +00:00
fixed 'race angle' setting: no crash, rotates immediately
This commit is contained in:
parent
7982ea0e58
commit
879549ca5d
12
racing.cpp
12
racing.cpp
@ -1039,10 +1039,16 @@ void race_projection() {
|
||||
if(GDIM == 2) {
|
||||
dialog::addMatrixItem(XLAT("race angle"), race_angle.get(), 'a');
|
||||
dialog::add_action([] () {
|
||||
dialog::editMatrix(race_angle.get(), XLAT("model orientation"), "", GDIM);
|
||||
dialog::editMatrix(race_angle.get(), XLAT("race angle"), "", GDIM);
|
||||
auto& d = dialog::get_di();
|
||||
println(hlog, format("d = %p", &d));
|
||||
auto q = rot_inverse(race_angle) * pconf.mori();
|
||||
auto last = dialog::get_ne().reaction;
|
||||
dialog::get_ne().reaction = [q, last] () { last(); pconf.mori() = race_angle * q; };
|
||||
auto last = d.reaction;
|
||||
d.reaction = [q, last] () {
|
||||
if(last) last();
|
||||
pconf.mori() = race_angle * q;
|
||||
if(racing::on) set_view();
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user