From d0dd9ec22f67b9eed6b6e5ecb78f01c560961e8c Mon Sep 17 00:00:00 2001 From: jacob1 Date: Wed, 21 Nov 2018 12:38:26 -0500 Subject: [PATCH] fix sim.brush being double size, fix compile warning --- src/lua/LuaScriptInterface.cpp | 6 +++--- src/simulation/Simulation.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lua/LuaScriptInterface.cpp b/src/lua/LuaScriptInterface.cpp index cf1272ea2..27853aad5 100644 --- a/src/lua/LuaScriptInterface.cpp +++ b/src/lua/LuaScriptInterface.cpp @@ -1936,9 +1936,9 @@ int LuaScriptInterface::simulation_brush(lua_State * l) } else { - ui::Point size = luacon_model->GetBrush()->GetSize(); - brushradiusX = size.X; - brushradiusY = size.Y; + ui::Point radius = luacon_model->GetBrush()->GetRadius(); + brushradiusX = radius.X; + brushradiusY = radius.Y; } int brushID = luaL_optint(l, 5, luacon_model->GetBrushID()); diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 22397ae91..2b7f1a1df 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -5143,7 +5143,7 @@ void Simulation::CheckStacking() excessive_stacking_found = 1; } } - else if (pmap_count[y][x]>1500 || (random_gen()%1600) <= (pmap_count[y][x]+100)) + else if (pmap_count[y][x]>1500 || (unsigned int)RNG::Ref().between(0, 1599) <= (pmap_count[y][x]+100)) { pmap_count[y][x] = pmap_count[y][x] + NPART; excessive_stacking_found = true;