1
0
Fork 0
mirror of https://github.com/demostf/demo.js synced 2026-06-04 00:54:14 +02:00

fix parsing pov stringtables

This commit is contained in:
Robin Appelman 2017-02-21 20:56:33 +01:00
commit f66ab3ffaf
3 changed files with 13 additions and 3 deletions

View file

@ -33,7 +33,11 @@ export function parseStringTable(stream: BitStream, table: StringTable, entries:
const restOfString = stream.readASCIIString();
value = history[index].text.substr(0, bytesToCopy) + restOfString;
if (!history[index].text) {
value = restOfString; // best guess, happens in some pov demos but only for unimported tables it seems
} else {
value = history[index].text.substr(0, bytesToCopy) + restOfString;
}
} else {
value = stream.readASCIIString();
}
@ -55,11 +59,11 @@ export function parseStringTable(stream: BitStream, table: StringTable, entries:
if (userData) {
existingEntry.extraData = userData;
}
history.push(existingEntry);
if (value) {
existingEntry.text = value;
}
history.push(existingEntry);
} else {
table.entries[entryIndex] = {
text: value,