Skip to content

Commit

Permalink
Fix warnings about an unused variables and implicit conversion (#10586)
Browse files Browse the repository at this point in the history
  • Loading branch information
red-001 committed Nov 12, 2020
1 parent 68139a2 commit 8eb2cba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gui/guiScrollBar.cpp
Expand Up @@ -21,7 +21,7 @@ GUIScrollBar::GUIScrollBar(IGUIEnvironment *environment, IGUIElement *parent, s3
is_horizontal(horizontal), is_auto_scaling(auto_scale),
dragged_by_slider(false), tray_clicked(false), scroll_pos(0),
draw_center(0), thumb_size(0), min_pos(0), max_pos(100), small_step(10),
large_step(50), last_change(0), drag_offset(0), page_size(100), border_size(0)
large_step(50), drag_offset(0), page_size(100), border_size(0)
{
refreshControls();
setNotClipped(false);
Expand Down
1 change: 0 additions & 1 deletion src/gui/guiScrollBar.h
Expand Up @@ -68,7 +68,6 @@ class GUIScrollBar : public IGUIElement
s32 max_pos;
s32 small_step;
s32 large_step;
u32 last_change;
s32 drag_offset;
s32 page_size;
s32 border_size;
Expand Down
6 changes: 5 additions & 1 deletion src/mapgen/mg_ore.cpp
Expand Up @@ -498,7 +498,11 @@ void OreVein::generate(MMVManip *vm, int mapseed, u32 blockseed,
}

// randval ranges from -1..1
float randval = (float)pr.next() / (pr.RANDOM_RANGE / 2) - 1.f;
/*
Note: can generate values slightly larger than 1
but this can't be changed as mapgen must be deterministic accross versions.
*/
float randval = (float)pr.next() / float(pr.RANDOM_RANGE / 2) - 1.f;
float noiseval = contour(noise->result[index]);
float noiseval2 = contour(noise2->result[index]);
if (noiseval * noiseval2 + randval * random_factor < nthresh)
Expand Down

0 comments on commit 8eb2cba

Please sign in to comment.