From 75926d538aa32934d83c024b03fd6d4e8417ff62 Mon Sep 17 00:00:00 2001 From: korenkonder Date: Sun, 8 Oct 2023 17:31:25 +0300 Subject: [PATCH] Fixed crash when using autofocus DOF and chara isn't present --- src/CRE/post_process/dof.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CRE/post_process/dof.cpp b/src/CRE/post_process/dof.cpp index e37f9ffa..bc7f9470 100644 --- a/src/CRE/post_process/dof.cpp +++ b/src/CRE/post_process/dof.cpp @@ -93,10 +93,10 @@ void post_process_dof::apply(RenderTexture* rt, RenderTexture* buf, GLuint* samp rob_chara* rob_chr = 0; for (int32_t i = 0; i < ROB_CHARA_COUNT; i++) { rob_chara* rob_chr = rob_chara_array_get(i); - if (!rob_chr->is_visible()) + if (!rob_chr || !rob_chr->is_visible()) continue; - mat4 mat = rob_chr->data.field_1E68.field_78[4]; // sub_1405163C0 + const mat4& mat = rob_chr->data.field_1E68.field_78[4]; // sub_1405163C0 vec3 chara_trans = 0.0f; mat4_get_translation(&mat, &chara_trans);