Commit d7bf4d12 authored by Richard Gobeille's avatar Richard Gobeille
Browse files

engine: print warning to console when loading maps that contain extra data...

engine: print warning to console when loading maps that contain extra data appended to the end of the file

I think TekWar is the only game that did this, but it's worth detecting since it means even simply re-saving those maps without purposeful changes will break them.
parent 44164e59
......@@ -10389,6 +10389,11 @@ int32_t engineLoadBoard(const char *filename, char flags, vec3_t *dapos, int16_t
if (kread_and_test(fil, sprite, sizeof(spritetype)*numsprites)) goto error;
int const pos = ktell(fil), len = kfilelength(fil);
if (pos != len)
initprintf("warning: ignoring %d bytes of unknown data appended to map file\n", len - pos);
#ifdef NEW_MAP_FORMAT
skip_reading_mapbin:
#endif
......@@ -10704,6 +10709,11 @@ int32_t engineLoadBoardV5V6(const char *filename, char fromwhere, vec3_t *dapos,
}
}
int const pos = ktell(fil), len = kfilelength(fil);
if (pos != len)
initprintf("warning: ignoring %d bytes of unknown data appended to map file\n", len - pos);
kclose(fil);
// Done reading file.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment