Draylar's Battle Towers

Draylar's Battle Towers

1M Downloads

Add check so that separation value is never greater than spacing value for structure

TelepathicGrunt opened this issue ยท 1 comments

commented

Fun fact, due to how getStartChunk is coded, setting the spacing to 0 will crash Math.floorDiv(chunkX, i) due to divide by 0 and setting separation equal to or greater than spacing will crash placementRandom.nextInt(i - j); due to bounds must be positive.

image

Since your config allows users to control both spacing and separation, you should add a failsafe to automatically set separation to be 1 less than spacing and warn users of the invalid values. Just giving you a heads up as I just helped someone figure out a crash because they set spacing and separation to be equal which led to placementRandom.nextInt(0); crashing lol

commented

Just added some config validation/warnings in the latest update. Thanks for the info and insight!