From 15d4fb8fcd86052216e0fd75f2bed5defb3bb961 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 17 Mar 2020 07:57:59 +0100 Subject: [PATCH] - fixed file existence check in TRNSLATE parser. --- src/r_data/r_translate.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/r_data/r_translate.cpp b/src/r_data/r_translate.cpp index f22402720..ed5ce9bc3 100644 --- a/src/r_data/r_translate.cpp +++ b/src/r_data/r_translate.cpp @@ -1550,29 +1550,29 @@ void R_ParseTrnslate() do { sc.MustGetToken(TK_StringConst); - try + int pallump = Wads.CheckNumForFullName(sc.String, true, ns_global); + if (pallump >= 0) // { - int pallump = Wads.CheckNumForFullName(sc.String, true, ns_global); - if (pallump) // + int start = 0; + if (sc.CheckToken(',')) { - int start = 0; - if (sc.CheckToken(',')) - { - sc.MustGetValue(false); - start = sc.Number; - } - uint8_t palette[768]; - int numcolors = ReadPalette(pallump, palette); - NewTranslation.AddColors(start, numcolors, palette); + sc.MustGetValue(false); + start = sc.Number; } - else + uint8_t palette[768]; + int numcolors = ReadPalette(pallump, palette); + NewTranslation.AddColors(start, numcolors, palette); + } + else + { + try { NewTranslation.AddToTranslation(sc.String); } - } - catch (CRecoverableError & err) - { - sc.ScriptMessage("Error in translation '%s':\n" TEXTCOLOR_YELLOW "%s\n", sc.String, err.GetMessage()); + catch (CRecoverableError & err) + { + sc.ScriptMessage("Error in translation '%s':\n" TEXTCOLOR_YELLOW "%s\n", sc.String, err.GetMessage()); + } } } while (sc.CheckToken(','));