summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/simulation/Simulation.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index cb59b15..b311465 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -935,7 +935,7 @@ void Simulation::ApplyDecorationBox(int x1, int y1, int x2, int y2, int colR, in
int Simulation::ToolClick(int x, int y, int tool)
{
- if(tools[tool])
+ if(tool >= 0 && tool < tools.size() && tools[tool])
{
Particle * cpart = NULL;
int r;
@@ -950,7 +950,7 @@ int Simulation::ToolClick(int x, int y, int tool)
int Simulation::ToolStart(int x, int y, int tool)
{
- if(tools[tool])
+ if(tool >= 0 && tool < tools.size() && tools[tool])
{
Particle * cpart = NULL;
int r;
@@ -965,7 +965,7 @@ int Simulation::ToolStart(int x, int y, int tool)
int Simulation::Tool(int x, int y, int tool, float strength)
{
- if(tools[tool])
+ if(tool >= 0 && tool < tools.size() && tools[tool])
{
Particle * cpart = NULL;
int r;