mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-08-04 21:04:02 +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) {
|
if(GDIM == 2) {
|
||||||
dialog::addMatrixItem(XLAT("race angle"), race_angle.get(), 'a');
|
dialog::addMatrixItem(XLAT("race angle"), race_angle.get(), 'a');
|
||||||
dialog::add_action([] () {
|
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 q = rot_inverse(race_angle) * pconf.mori();
|
||||||
auto last = dialog::get_ne().reaction;
|
auto last = d.reaction;
|
||||||
dialog::get_ne().reaction = [q, last] () { last(); pconf.mori() = race_angle * q; };
|
d.reaction = [q, last] () {
|
||||||
|
if(last) last();
|
||||||
|
pconf.mori() = race_angle * q;
|
||||||
|
if(racing::on) set_view();
|
||||||
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user