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

Make null check more specific, not just falsy

This commit is contained in:
George Pittarelli 2017-03-10 10:28:38 -08:00 committed by GitHub
commit 10650528f5

View file

@ -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 && 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;
} }
} }