Unlock TerrainInstance max limit

This commit is contained in:
kayomn 2023-01-11 11:38:32 +00:00
parent 422361b278
commit c061864c37
2 changed files with 4 additions and 6 deletions

BIN
editor.scn (Stored with Git LFS)

Binary file not shown.

View File

@ -1,8 +1,6 @@
@tool @tool
class_name TerrainInstance3D extends GeometryInstance3D class_name TerrainInstance3D extends GeometryInstance3D
const _TERRAIN_MAX := 1024
var _mesh := PlaneMesh.new() var _mesh := PlaneMesh.new()
var _material := ShaderMaterial.new() var _material := ShaderMaterial.new()
@ -16,8 +14,8 @@ var size: Vector2i = Vector2i.ZERO:
return size return size
set(value): set(value):
var width := clampi(value.x, 0, _TERRAIN_MAX) var width := maxi(value.x, 0)
var height := clampi(value.y, 0, _TERRAIN_MAX) var height := maxi(value.y, 0)
if (width != size.x) or (height != size.y): if (width != size.x) or (height != size.y):
if (width == 0) and (height == 0): if (width == 0) and (height == 0):