| 954 | best_bad = Some(scratch); |
| 955 | } |
| 956 | } |
| 957 | if any_clean { |
| 958 | continue; |
| 959 | } |
| 960 | if let Some(bad) = best_bad { |
| 961 | ctx.report.warnings += bad.warnings; |
| 962 | ctx.report.errors += bad.errors; |
| 963 | ctx.report.messages.extend(bad.messages); |
| 964 | } |
| 965 | } |
| 966 | } |
| 967 | |
| 968 | fn validate_script_value_node_ref_hint( |
| 969 | ctx: &mut NodeRefValidationCtx<'_>, |
| 970 | label: &str, |
| 971 | value: &SceneValue, |
| 972 | field: &DoctorField, |
| 973 | index: &ScriptDoctorIndex, |
| 974 | ) { |
| 975 | if is_node_id_type_for_doctor(&field.ty) |
| 976 | && let SceneValue::Key(key) = value |
| 977 | { |
| 978 | let hint = doctor_node_ref_hint(&field.node_ref_types); |
| 979 | validate_one_node_ref_hint(ctx, label, key.as_ref(), hint); |
| 980 | return; |
| 981 | } |
| 982 | if let SceneValue::Object(values) = value |
| 983 | && let Some(nested) = index.custom_type_fields.get(&field.ty) |
| 984 | { |