mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-09-01 04:01:56 +02:00
Fix gravity zones not being drawn in some cases
Namely, gravity zones would be rendered when the wrong wall (i.e. not Gravity wall) was selected if custom tools were present in the SC_WALL menu section. This was because their rendering was tied to a tool index into the SC_WALL menu section, rather than to a tool identifier.
This commit is contained in:
@@ -1111,8 +1111,11 @@ void GameController::SetActiveTool(int toolSelection, Tool * tool)
|
||||
gameModel->SetLastTool(tool);
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
if(gameModel->GetActiveTool(i) == gameModel->GetMenuList().at(SC_WALL)->GetToolList().at(WL_GRAV))
|
||||
auto *activeTool = gameModel->GetActiveTool(i);
|
||||
if (activeTool && activeTool->Identifier == "DEFAULT_WL_GRVTY")
|
||||
{
|
||||
gameModel->GetRenderer()->gravityZonesEnabled = true;
|
||||
}
|
||||
}
|
||||
if (tool->Identifier == "DEFAULT_UI_PROPERTY")
|
||||
{
|
||||
|
Reference in New Issue
Block a user