JamesTKhan / Mundus

A 3D world/level editor built with Java, Kotlin & libGDX.
Apache License 2.0
156 stars 22 forks source link

Terrain activation if helper lines disabled fix #269

Closed Dgzt closed 11 months ago

Dgzt commented 11 months ago

Currently if helper lines is not enabled and activate a deactivated terrain then there is an exception.

Caused by: java.lang.IllegalArgumentException: Step must be positive, was: -1.
    at kotlin.ranges.RangesKt__RangesKt.checkStepIsPositive(Ranges.kt:274)
    at kotlin.ranges.RangesKt___RangesKt.step(_Ranges.kt:966)
    at com.mbrlabs.mundus.editor.core.helperlines.HexagonHelperLineShape.calculate(HexagonHelperLineShape.kt:137)
    at com.mbrlabs.mundus.editor.core.helperlines.HexagonHelperLineShape.calculateIndicesNum(HexagonHelperLineShape.kt:44)
    at com.mbrlabs.mundus.editor.core.helperlines.HelperLineShape.<init>(HelperLineShape.kt:66)
    at com.mbrlabs.mundus.editor.core.helperlines.HexagonHelperLineShape.<init>(HexagonHelperLineShape.kt:27)
    at com.mbrlabs.mundus.editor.core.helperlines.HelperLines.addNewHelperLineShape(HelperLines.kt:115)
    at com.mbrlabs.mundus.editor.core.helperlines.HelperLines.onGameObjectModified(HelperLines.kt:94)
    ... 19 more