- fixed file existence check in TRNSLATE parser.

This commit is contained in:
Christoph Oelckers 2020-03-17 07:57:59 +01:00
parent 828cba13a1
commit 15d4fb8fcd

View file

@ -1550,29 +1550,29 @@ void R_ParseTrnslate()
do do
{ {
sc.MustGetToken(TK_StringConst); 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); int start = 0;
if (pallump) // if (sc.CheckToken(','))
{ {
int start = 0; sc.MustGetValue(false);
if (sc.CheckToken(',')) start = sc.Number;
{
sc.MustGetValue(false);
start = sc.Number;
}
uint8_t palette[768];
int numcolors = ReadPalette(pallump, palette);
NewTranslation.AddColors(start, numcolors, palette);
} }
else uint8_t palette[768];
int numcolors = ReadPalette(pallump, palette);
NewTranslation.AddColors(start, numcolors, palette);
}
else
{
try
{ {
NewTranslation.AddToTranslation(sc.String); NewTranslation.AddToTranslation(sc.String);
} }
} catch (CRecoverableError & err)
catch (CRecoverableError & err) {
{ sc.ScriptMessage("Error in translation '%s':\n" TEXTCOLOR_YELLOW "%s\n", sc.String, err.GetMessage());
sc.ScriptMessage("Error in translation '%s':\n" TEXTCOLOR_YELLOW "%s\n", sc.String, err.GetMessage()); }
} }
} while (sc.CheckToken(',')); } while (sc.CheckToken(','));