From d684deea00b4b38e50ad8136c8a4f03ad120d5dd Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Fri, 15 Nov 2024 21:30:05 +0100 Subject: [PATCH] changed handling some conditions --- src/screens.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/screens.c b/src/screens.c index a26d2d11..b506dbbb 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1079,9 +1079,11 @@ static char *getInfoTextBuffer_BD(char *text_raw) static char *getLevelSetInfoBuffer(void) { - if (level.game_engine_type == GAME_ENGINE_TYPE_BD && - level.native_bd_level->caveset != NULL && - level.native_bd_level->caveset->story != NULL) + if (level.game_engine_type != GAME_ENGINE_TYPE_BD || + level.native_bd_level->caveset == NULL) + return NULL; + + if (level.native_bd_level->caveset->story != NULL) return getInfoTextBuffer_BD(level.native_bd_level->caveset->story); return NULL; @@ -1089,9 +1091,11 @@ static char *getLevelSetInfoBuffer(void) static char *getLevelInfoBuffer(void) { - if (level.game_engine_type == GAME_ENGINE_TYPE_BD && - level.native_bd_level->cave != NULL && - level.native_bd_level->cave->story != NULL) + if (level.game_engine_type != GAME_ENGINE_TYPE_BD || + level.native_bd_level->cave == NULL) + return NULL; + + if (level.native_bd_level->cave->story != NULL) return getInfoTextBuffer_BD(level.native_bd_level->cave->story); return NULL; -- 2.34.1