mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-09 09:56:35 +02:00
fix wind line from lua changing brush size, allow setting wind tool strength
This commit is contained in:
@@ -1434,9 +1434,11 @@ int LuaScriptInterface::simulation_toolLine(lua_State * l)
|
|||||||
|
|
||||||
if (tool == (int)luacon_sim->tools.size())
|
if (tool == (int)luacon_sim->tools.size())
|
||||||
{
|
{
|
||||||
Tool *WindTool = luacon_model->GetToolFromIdentifier("DEFAULT_UI_WIND");
|
Tool *windTool = luacon_model->GetToolFromIdentifier("DEFAULT_UI_WIND");
|
||||||
WindTool->DrawLine(luacon_sim, brushList[brush], ui::Point(x1, y1), ui::Point(x2, y2));
|
float oldStrength = windTool->GetStrength();
|
||||||
return 1;
|
windTool->SetStrength(strength);
|
||||||
|
windTool->DrawLine(luacon_sim, brushList[brush], ui::Point(x1, y1), ui::Point(x2, y2));
|
||||||
|
windTool->SetStrength(oldStrength);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
luacon_sim->ToolLine(x1, y1, x2, y2, tool, brushList[brush], strength);
|
luacon_sim->ToolLine(x1, y1, x2, y2, tool, brushList[brush], strength);
|
||||||
|
Reference in New Issue
Block a user