mirror of
https://github.com/demostf/demo.js
synced 2026-06-04 00:54:14 +02:00
dont crash on missing weapon
This commit is contained in:
parent
318a327b36
commit
cfd008eb2a
1 changed files with 3 additions and 0 deletions
|
|
@ -140,6 +140,9 @@ function handleEntity(entity: PacketEntity, match: Match) {
|
||||||
break;
|
break;
|
||||||
case 'CWeaponMedigun':
|
case 'CWeaponMedigun':
|
||||||
const weapon = <CWeaponMedigun>match.weaponMap[entity.entityIndex];
|
const weapon = <CWeaponMedigun>match.weaponMap[entity.entityIndex];
|
||||||
|
if (!weapon) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (const prop of entity.props) {
|
for (const prop of entity.props) {
|
||||||
const propName = prop.definition.ownerTableName + '.' + prop.definition.name;
|
const propName = prop.definition.ownerTableName + '.' + prop.definition.name;
|
||||||
switch (propName) {
|
switch (propName) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue