mirror of
https://github.com/demostf/demo.js
synced 2026-06-04 09:04:13 +02:00
fix writeVarInt when writing 128
This commit is contained in:
parent
7dba1babe7
commit
c9c764aad0
2 changed files with 2 additions and 8 deletions
|
|
@ -149,6 +149,7 @@ export function ParsePacketEntities(
|
|||
for (let i = 0; i < updatedEntries; i++) {
|
||||
const diff = readUBitVar(stream);
|
||||
entityId += 1 + diff;
|
||||
|
||||
const pvs = readPVSType(stream);
|
||||
if (pvs === PVS.ENTER) {
|
||||
const packetEntity = readEnterPVS(stream, entityId, state, baseLine);
|
||||
|
|
@ -167,10 +168,6 @@ export function ParsePacketEntities(
|
|||
if (!sendTable) {
|
||||
throw new Error(`Unknown sendTable ${packetEntity.serverClass.dataTable}`);
|
||||
}
|
||||
if (entityId === 55) {
|
||||
console.log(`decode preserve: ${entityId} = ${sendTable.name}, ${receivedEntities.length}/${i} ${stream.index} ${end} tick ${state.tick}`);
|
||||
console.log(receivedEntities[receivedEntities.length - 1], start, entityId, diff);
|
||||
}
|
||||
const updatedProps = getEntityUpdate(sendTable, stream);
|
||||
packetEntity.applyPropUpdate(updatedProps);
|
||||
receivedEntities.push(packetEntity);
|
||||
|
|
@ -238,9 +235,6 @@ export function EncodePacketEntities(packet: PacketEntitiesPacket, stream: BitSt
|
|||
writeEnterPVS(entity, stream, state, packet.baseLine);
|
||||
} else if (entity.pvs === PVS.PRESERVE) {
|
||||
const sendTable = getSendTable(state, entity.serverClass.dataTable);
|
||||
if (entity.entityIndex === 55) {
|
||||
console.log(`encode preserve: ${entity.entityIndex} = ${entity.serverClass.dataTable}`);
|
||||
}
|
||||
encodeEntityUpdate(entity.props, sendTable, stream);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue