mirror of
https://github.com/demostf/demo.js
synced 2026-06-03 16:44:12 +02:00
fix parsing pov stringtables
This commit is contained in:
parent
2519a349d5
commit
f66ab3ffaf
3 changed files with 13 additions and 3 deletions
|
|
@ -23,7 +23,9 @@ export function handleStringTable(packet: StringTablePacket, match: Match) {
|
|||
}
|
||||
if (table.name === 'instancebaseline') {
|
||||
for (const instanceBaseLine of table.entries) {
|
||||
saveInstanceBaseLine(instanceBaseLine, match);
|
||||
if (instanceBaseLine) {
|
||||
saveInstanceBaseLine(instanceBaseLine, match);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -21,4 +21,8 @@ suite('Parse basic demo info', () => {
|
|||
test('Parse demo with new celt voice codec', () => {
|
||||
testDemo('celt');
|
||||
});
|
||||
|
||||
test('Parse pov demo', () => {
|
||||
testDemo('pov');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue