From: Holger Schemel Date: Sat, 27 Aug 2022 09:01:50 +0000 (+0200) Subject: added ignoring remaining level chunks after chunks with errors X-Git-Tag: 4.3.3.0~70 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=84a0a448bb1715b6dea187e3aedc902e5bbc2439;p=rocksndiamonds.git added ignoring remaining level chunks after chunks with errors --- diff --git a/src/files.c b/src/files.c index 49fe4856..e86364db 100644 --- a/src/files.c +++ b/src/files.c @@ -3591,6 +3591,14 @@ static void LoadLevelFromFileInfo_RND(struct LevelInfo *level, int chunk_size_expected = (chunk_info[i].loader)(file, chunk_size, level); + if (chunk_size_expected < 0) + { + Warn("error reading chunk '%s' in level file '%s'", + chunk_name, filename); + + break; + } + // the size of some chunks cannot be checked before reading other // chunks first (like "HEAD" and "BODY") that contain some header // information, so check them here