1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 07:43:01 +01:00

Catch window refs by reference instead of copy

This commit is contained in:
Hielke Morsink
2022-08-02 21:55:23 +02:00
committed by GitHub
parent 2765ed45d2
commit eec99b6fae

View File

@@ -729,7 +729,7 @@ rct_window* window_bring_to_front_by_number(rct_windowclass cls, rct_windownumbe
*/ */
void window_push_others_right(rct_window& window) void window_push_others_right(rct_window& window)
{ {
window_visit_each([window](rct_window* w) { window_visit_each([&window](rct_window* w) {
if (w == &window) if (w == &window)
return; return;
if (w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT)) if (w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT))
@@ -761,7 +761,7 @@ void window_push_others_right(rct_window& window)
void window_push_others_below(rct_window& w1) void window_push_others_below(rct_window& w1)
{ {
// Enumerate through all other windows // Enumerate through all other windows
window_visit_each([w1](rct_window* w2) { window_visit_each([&w1](rct_window* w2) {
if (&w1 == w2) if (&w1 == w2)
return; return;
// ? // ?