changed handling some conditions
authorHolger Schemel <holger.schemel@virtion.de>
Fri, 15 Nov 2024 20:30:05 +0000 (21:30 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Fri, 15 Nov 2024 20:30:05 +0000 (21:30 +0100)
src/screens.c

index a26d2d11859e56c132691dc7e9e3e6a3fbba26ef..b506dbbb5b5f8d413a3f370a24104c293f8d606c 100644 (file)
@@ -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;