fix: recover players from shallow freshwater

This commit is contained in:
Alexander Sellite 2026-08-23 00:50:45 -04:00
parent d2ee4a515e
commit 8dbeb06e73
6 changed files with 65 additions and 7 deletions

View file

@ -151,6 +151,11 @@ func _validate_portable_water_body() -> void:
water_body.set("surface_size", Vector2(12.0, 8.0))
water_body.set("fishing_depth", 6.0)
water_body.set("recovery_depth", 7.0)
water_body.set(
"recovery_entry_height_reference",
PlayerWaterTrigger.EntryHeightReference.PLAYER_ORIGIN,
)
water_body.set("recovery_entry_depth_threshold", 0.1)
water_body.set("fish_pool", PondPool)
root.add_child(water_body)
await process_frame
@ -169,8 +174,15 @@ func _validate_portable_water_body() -> void:
assert(is_equal_approx(fishing_region.get_surface_height(), 7.0))
assert(is_equal_approx(fishing_shape_node.position.y, -3.0))
assert(fishing_shape.size.is_equal_approx(Vector3(12.0, 6.0, 8.0)))
var recovery_region := water_body.get_node("RecoveryRegion") as Area3D
var recovery_region := (
water_body.get_node("RecoveryRegion") as PlayerWaterTrigger
)
assert(is_equal_approx(recovery_region.position.y, -3.5))
assert(
recovery_region.entry_height_reference
== PlayerWaterTrigger.EntryHeightReference.PLAYER_ORIGIN
)
assert(is_equal_approx(recovery_region.entry_depth_threshold, 0.1))
water_body.queue_free()
await process_frame