mirror of
https://github.com/demostf/demo.js
synced 2026-06-04 00:54:14 +02:00
dont modify match state in gameevent packet handler
This commit is contained in:
parent
7cb74d93de
commit
95b9fb55c7
4 changed files with 18 additions and 5 deletions
|
|
@ -5,8 +5,9 @@ import {Match} from "../../Data/Match";
|
|||
|
||||
export function GameEventList(stream: BitStream, match: Match): GameEventListPacket { // 30: gameEventList
|
||||
// list of game events and parameters
|
||||
const numEvents = stream.readBits(9);
|
||||
const length = stream.readBits(20);
|
||||
const numEvents = stream.readBits(9);
|
||||
const length = stream.readBits(20);
|
||||
const eventList: GameEventDefinitionMap = {};
|
||||
for (let i = 0; i < numEvents; i++) {
|
||||
const id = stream.readBits(9);
|
||||
const name = stream.readASCIIString();
|
||||
|
|
@ -19,13 +20,14 @@ export function GameEventList(stream: BitStream, match: Match): GameEventListPac
|
|||
});
|
||||
type = stream.readBits(3);
|
||||
}
|
||||
match.eventDefinitions[id] = {
|
||||
eventList[id] = {
|
||||
id: id,
|
||||
name: name,
|
||||
entries: entries
|
||||
};
|
||||
}
|
||||
return {
|
||||
packetType: 'gameEventList'
|
||||
packetType: 'gameEventList',
|
||||
eventList: eventList
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue