From 46d485590195aaccd8c6c3b305a1a3f8f3cb4b4f Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Tue, 26 Nov 2019 08:24:10 +0000 Subject: [PATCH] Fix the ifcrc token: 0 is a valid CRC32 result! git-svn-id: https://svn.eduke32.com/eduke32@8296 1a8010ca-5511-0410-912e-c29ae57300e0 # Conflicts: # source/build/src/defs.cpp --- source/build/src/defs.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/build/src/defs.cpp b/source/build/src/defs.cpp index 85f759bc2..0d0577e4f 100644 --- a/source/build/src/defs.cpp +++ b/source/build/src/defs.cpp @@ -650,7 +650,8 @@ static int32_t defsparser(scriptfile *script) int32_t havexoffset = 0, haveyoffset = 0, haveextra = 0; int32_t xoffset = 0, yoffset = 0; int32_t istexture = 0; - int32_t tilecrc = 0, origcrc = 0; + int32_t tilecrc = 0; + uint8_t have_ifcrc = 0; int32_t extra = 0; static const tokenlist tilefromtexturetokens[] = @@ -695,6 +696,7 @@ static int32_t defsparser(scriptfile *script) break; case T_IFCRC: scriptfile_getsymbol(script, &tilecrc); + have_ifcrc = 1; break; case T_TEXHITSCAN: flags |= PICANM_TEXHITSCAN_BIT; @@ -721,9 +723,9 @@ static int32_t defsparser(scriptfile *script) break; } - if (tilecrc) + if (have_ifcrc) { - origcrc = tileCRC(tile); + int32_t origcrc = tileCRC(tile); if (origcrc != tilecrc) { //initprintf("CRC of tile %d doesn't match! CRC: %d, Expected: %d\n", tile, origcrc, tilecrc);