feat: push error if either the top left or bottom right markers arent set

This commit is contained in:
dusk 2024-09-06 19:16:20 +09:00
parent a2529a776f
commit c0936e9476
Signed by: dusk
SSH Key Fingerprint: SHA256:Abmvag+juovVufZTxyWY8KcVgrznxvBjQpJesv071Aw

View File

@ -113,6 +113,9 @@ func _ready() -> void:
## calculates the extents of the water. ## calculates the extents of the water.
func calc_extents() -> void: func calc_extents() -> void:
if top_left_marker == null or bottom_right_marker == null:
push_error("either top left or bottom right marker is not set")
return
top_left_point = top_left_marker.position top_left_point = top_left_marker.position
bottom_right_point = bottom_right_marker.position bottom_right_point = bottom_right_marker.position
extents_valid = _validate_extents() extents_valid = _validate_extents()