Skip to content

Commit cd825e0

Browse files
committed
Default initialize scroll_state properly
1 parent 8f9688b commit cd825e0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

plugins/edgescroll.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ DFhackCExport command_result plugin_shutdown([[maybe_unused]] color_ostream &out
5656
static std::atomic_bool callback_queued = false;
5757

5858
struct scroll_state {
59-
int8_t xdiff;
60-
int8_t ydiff;
59+
int8_t xdiff = 0;
60+
int8_t ydiff = 0;
6161
};
6262

6363
static scroll_state state;
6464
static scroll_state queued;
6565

6666
static void render_thread_cb() {
67-
queued = {0};
67+
queued = {};
6868
// Ignore the mouse if outside the window
6969
if (!enabler->mouse_focus) {
7070
callback_queued.store(false);
@@ -107,7 +107,7 @@ static bool update_mouse_pos() {
107107

108108
// Queued callback complete, save the results and enqueue again
109109
state = queued;
110-
queued = {0};
110+
queued = {};
111111
DFHack::runOnRenderThread(render_thread_cb);
112112
callback_queued.store(true);
113113
return true;

0 commit comments

Comments
 (0)