Update example_scripts/fort.js

Exception message was incorrect and I've moved the size-check to just after the statement that increases size if odd.
This commit is contained in:
Walter Higgins 2013-01-03 08:36:49 +00:00
parent 85f850c79f
commit 20f2f6ec89

View file

@ -8,11 +8,11 @@ Drone.extend('fort', function(side, height)
side = 18;
if (typeof height == "undefined")
height = 6;
if (height < 4 || side < 10)
throw new java.lang.RuntimeException("Forts must be at least 9 wide X 4 tall");
// make sure side is even
if (side%2)
side++;
if (height < 4 || side < 10)
throw new java.lang.RuntimeException("Forts must be at least 10 wide X 4 tall");
var brick = 98;
//
// build walls.