mirror of
https://github.com/demostf/demo.js
synced 2026-06-03 16:44:12 +02:00
minor cleanup
This commit is contained in:
parent
255602d1e2
commit
15704c89fc
1 changed files with 0 additions and 3 deletions
|
|
@ -8,10 +8,8 @@ import {SendTable} from "../Data/SendTable";
|
||||||
export function applyEntityUpdate(entity: PacketEntity, sendTable: SendTable, stream: BitStream): PacketEntity {
|
export function applyEntityUpdate(entity: PacketEntity, sendTable: SendTable, stream: BitStream): PacketEntity {
|
||||||
let index = -1;
|
let index = -1;
|
||||||
const allProps = sendTable.flattenedProps;
|
const allProps = sendTable.flattenedProps;
|
||||||
let lastProps:SendProp[] = [];
|
|
||||||
while ((index = readFieldIndex(stream, index)) != -1) {
|
while ((index = readFieldIndex(stream, index)) != -1) {
|
||||||
if (index >= 4096 || index > allProps.length) {
|
if (index >= 4096 || index > allProps.length) {
|
||||||
console.log(lastProps[lastProps.length - 1]);
|
|
||||||
throw new Error('prop index out of bounds while applying update for ' + sendTable.name + ' got ' + index
|
throw new Error('prop index out of bounds while applying update for ' + sendTable.name + ' got ' + index
|
||||||
+ ' property only has ' + allProps.length + ' properties');
|
+ ' property only has ' + allProps.length + ' properties');
|
||||||
}
|
}
|
||||||
|
|
@ -21,7 +19,6 @@ export function applyEntityUpdate(entity: PacketEntity, sendTable: SendTable, st
|
||||||
|
|
||||||
const prop = existingProp ? existingProp : new SendProp(propDefinition);
|
const prop = existingProp ? existingProp : new SendProp(propDefinition);
|
||||||
prop.value = SendPropParser.decode(propDefinition, stream);
|
prop.value = SendPropParser.decode(propDefinition, stream);
|
||||||
lastProps.push(prop);
|
|
||||||
|
|
||||||
if (!existingProp) {
|
if (!existingProp) {
|
||||||
entity.props.push(prop);
|
entity.props.push(prop);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue