From: Holger Schemel Date: Fri, 15 Nov 2024 20:30:05 +0000 (+0100) Subject: changed handling some conditions X-Git-Tag: 4.4.0.0-test-4~57 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=d684deea00b4b38e50ad8136c8a4f03ad120d5dd;p=rocksndiamonds.git changed handling some conditions --- 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;