mirror of
https://github.com/demostf/demo.js
synced 2026-06-04 00:54:14 +02:00
fix futher playerid errors
This commit is contained in:
parent
019fe99a4c
commit
981719e797
2 changed files with 5 additions and 5 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "tf2-demo",
|
"name": "tf2-demo",
|
||||||
"description": "A parser for TF2 demo files",
|
"description": "A parser for TF2 demo files",
|
||||||
"version": "0.2.4",
|
"version": "0.2.5",
|
||||||
"bin": {
|
"bin": {
|
||||||
"demo-analyse": "./bin/analyse.js"
|
"demo-analyse": "./bin/analyse.js"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
8
state.js
8
state.js
|
|
@ -51,15 +51,15 @@ State.prototype.updateState = function (packet) {
|
||||||
case 'gameEvent':
|
case 'gameEvent':
|
||||||
switch (packet.event.name) {
|
switch (packet.event.name) {
|
||||||
case 'player_death':
|
case 'player_death':
|
||||||
if (packet.event.values.assister > 256 && packet.event.values.assister < 512) {
|
while (packet.event.values.assister > 256 && packet.event.values.assister < (1024 * 16)) {
|
||||||
packet.event.values.assister -= 256;
|
packet.event.values.assister -= 256;
|
||||||
}
|
}
|
||||||
var assister = packet.event.values.assister < 256 ? packet.event.values.assister : null;
|
var assister = packet.event.values.assister < 256 ? packet.event.values.assister : null;
|
||||||
// todo get player names, not same id as the name string table
|
// todo get player names, not same id as the name string table
|
||||||
if (packet.event.values.attacker > 256) {
|
while (packet.event.values.attacker > 256) {
|
||||||
packet.event.values.attacker -= 256;
|
packet.event.values.attacker -= 256;
|
||||||
}
|
}
|
||||||
if (packet.event.values.userid > 256) {
|
while (packet.event.values.userid > 256) {
|
||||||
packet.event.values.userid -= 256;
|
packet.event.values.userid -= 256;
|
||||||
}
|
}
|
||||||
this.state.deaths.push({
|
this.state.deaths.push({
|
||||||
|
|
@ -99,7 +99,7 @@ State.prototype.updateState = function (packet) {
|
||||||
State.prototype.getUserState = function (userId) {
|
State.prototype.getUserState = function (userId) {
|
||||||
// no clue why it does this
|
// no clue why it does this
|
||||||
// only seems to be the case with per user ready
|
// only seems to be the case with per user ready
|
||||||
if (userId > 256) {
|
while (userId > 256) {
|
||||||
userId -= 256;
|
userId -= 256;
|
||||||
}
|
}
|
||||||
if (!this.state.users[userId]) {
|
if (!this.state.users[userId]) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue