1
0
Fork 0
mirror of https://github.com/demostf/demo.js synced 2026-06-03 16:44:12 +02:00

Fix possibly-null type errors

This commit is contained in:
George Pittarelli 2017-03-09 22:06:42 -08:00
commit 3a5b909419
2 changed files with 3 additions and 3 deletions

View file

@ -8,7 +8,7 @@ export class SendPropDefinition {
highValue: number;
bitCount: number;
table: SendTable|null;
numElements: number|null;
numElements: number;
arrayProperty: SendPropDefinition|null;
ownerTableName: string;
@ -21,7 +21,7 @@ export class SendPropDefinition {
this.highValue = 0;
this.bitCount = 0;
this.table = null;
this.numElements = null;
this.numElements = 0;
this.arrayProperty = null;
this.ownerTableName = ownerTableName;
}

View file

@ -94,7 +94,7 @@ function handleEntity(entity: PacketEntity, match: Match) {
}
}
if (prop.definition.ownerTableName === 'm_iAmmo') {
if (prop.value > 0) {
if (prop.value && prop.value > 0) {
player.ammo[parseInt(prop.definition.name, 10)] = <number>prop.value;
}
}