fix wind line from lua changing brush size, allow setting wind tool strength

This commit is contained in:
jacob1 2015-09-28 23:53:14 -04:00
parent 0a907c5177
commit 1f7b6a6bb4

View File

@ -1434,9 +1434,11 @@ int LuaScriptInterface::simulation_toolLine(lua_State * l)
if (tool == (int)luacon_sim->tools.size())
{
Tool *WindTool = luacon_model->GetToolFromIdentifier("DEFAULT_UI_WIND");
WindTool->DrawLine(luacon_sim, brushList[brush], ui::Point(x1, y1), ui::Point(x2, y2));
return 1;
Tool *windTool = luacon_model->GetToolFromIdentifier("DEFAULT_UI_WIND");
float oldStrength = windTool->GetStrength();
windTool->SetStrength(strength);
windTool->DrawLine(luacon_sim, brushList[brush], ui::Point(x1, y1), ui::Point(x2, y2));
windTool->SetStrength(oldStrength);
}
else
luacon_sim->ToolLine(x1, y1, x2, y2, tool, brushList[brush], strength);