NEON-28: fix occluder key check order for freed instances
parent
15d304fa2c
commit
f0ff5c9d77
|
|
@ -227,8 +227,11 @@ static func occlusion_policy_is_valid(policy: Resource) -> bool:
|
||||||
|
|
||||||
## True if [param body] is a live [Node3D] suitable as an [member _occluder_overrides] key.
|
## True if [param body] is a live [Node3D] suitable as an [member _occluder_overrides] key.
|
||||||
## Used before occlusion ray work and from tests (NEON-28).
|
## Used before occlusion ray work and from tests (NEON-28).
|
||||||
|
## [code]is_instance_valid[/code] first: [code]is Node3D[/code] on a freed reference errors at runtime.
|
||||||
static func occluder_override_key_is_valid(body: Variant) -> bool:
|
static func occluder_override_key_is_valid(body: Variant) -> bool:
|
||||||
return body is Node3D and is_instance_valid(body)
|
if not is_instance_valid(body):
|
||||||
|
return false
|
||||||
|
return body is Node3D
|
||||||
|
|
||||||
|
|
||||||
func _restore_occluder_overrides_list(overrides: Array) -> void:
|
func _restore_occluder_overrides_list(overrides: Array) -> void:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue