mirror of
https://github.com/demostf/demo.js
synced 2026-06-04 00:54:14 +02:00
only apply updates for entities from the current packet
This commit is contained in:
parent
641f5419df
commit
7cb74d93de
8 changed files with 46 additions and 50 deletions
|
|
@ -1,18 +1,16 @@
|
|||
import {PacketEntitiesPacket} from "../Data/Packet";
|
||||
import {Match} from "../Data/Match";
|
||||
import {Entity} from "../Data/Entity";
|
||||
import {PacketEntity} from "../Data/PacketEntity";
|
||||
import {Vector} from "../Data/Vector";
|
||||
import {Player} from "../Data/Player";
|
||||
|
||||
export function handlePacketEntities(packet: PacketEntitiesPacket, match: Match) {
|
||||
for (const entity of match.entities) {
|
||||
if (entity) {
|
||||
handleEntity(entity, match);
|
||||
}
|
||||
for (const entity of packet.entities) {
|
||||
handleEntity(entity, match);
|
||||
}
|
||||
}
|
||||
|
||||
function handleEntity(entity: Entity, match: Match) {
|
||||
function handleEntity(entity: PacketEntity, match: Match) {
|
||||
switch (entity.serverClass.name) {
|
||||
case 'CWorld':
|
||||
match.world.boundaryMin = <Vector>entity.getProperty('DT_WORLD', 'm_WorldMins').value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue