mirror of
https://github.com/demostf/demo.js
synced 2026-06-04 00:54:14 +02:00
Merge pull request #4 from gpittarelli/possibly-null-fixes
Fix possibly-null type errors
This commit is contained in:
commit
d3413636ce
2 changed files with 3 additions and 3 deletions
|
|
@ -8,7 +8,7 @@ export class SendPropDefinition {
|
||||||
highValue: number;
|
highValue: number;
|
||||||
bitCount: number;
|
bitCount: number;
|
||||||
table: SendTable|null;
|
table: SendTable|null;
|
||||||
numElements: number|null;
|
numElements: number;
|
||||||
arrayProperty: SendPropDefinition|null;
|
arrayProperty: SendPropDefinition|null;
|
||||||
ownerTableName: string;
|
ownerTableName: string;
|
||||||
|
|
||||||
|
|
@ -21,7 +21,7 @@ export class SendPropDefinition {
|
||||||
this.highValue = 0;
|
this.highValue = 0;
|
||||||
this.bitCount = 0;
|
this.bitCount = 0;
|
||||||
this.table = null;
|
this.table = null;
|
||||||
this.numElements = null;
|
this.numElements = 0;
|
||||||
this.arrayProperty = null;
|
this.arrayProperty = null;
|
||||||
this.ownerTableName = ownerTableName;
|
this.ownerTableName = ownerTableName;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ function handleEntity(entity: PacketEntity, match: Match) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (prop.definition.ownerTableName === 'm_iAmmo') {
|
if (prop.definition.ownerTableName === 'm_iAmmo') {
|
||||||
if (prop.value > 0) {
|
if (prop.value !== null && prop.value > 0) {
|
||||||
player.ammo[parseInt(prop.definition.name, 10)] = <number>prop.value;
|
player.ammo[parseInt(prop.definition.name, 10)] = <number>prop.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue