stack overflow in scripts shouldn't crash the game, fixes #934

This commit is contained in:
gnembon committed 2021-06-25 23:31:46 -03:00
1 parent bf6fddd645
commit 8fa54c8146
3 files changed
+28 -6

No files matched your search

@@ -82,6 +82,10 @@ public class CarpetExpression
{
throw new CarpetExpressionException("Math doesn't compute... "+ae.getMessage(), null);
}
catch (StackOverflowError soe)
{
throw new CarpetExpressionException("Your thoughts are too deep", null);
}
}
public Value scriptRunCommand(ScriptHost host, BlockPos pos)
@@ -115,5 +119,9 @@ public class CarpetExpression
{
throw new CarpetExpressionException("Math doesn't compute... "+ae.getMessage(), null);
}
catch (StackOverflowError soe)
{
throw new CarpetExpressionException("Your thoughts are too deep", null);
}
}
}