1
0
Fork 0
mirror of https://github.com/demostf/demo.js synced 2026-06-04 00:54:14 +02:00

add fallback for getting teams from entity props

This commit is contained in:
Robin Appelman 2018-03-09 00:04:13 +01:00
commit 2cccec390a
2 changed files with 5 additions and 1 deletions

View file

@ -38,6 +38,10 @@ export function handleHL2DMEntity(entity: PacketEntity, match: Match, message: P
}
const propName = prop.definition.ownerTableName + '.' + prop.definition.name;
switch (propName) {
case 'DT_BaseEntity.m_iTeamNum':
if (!player.user.team) {
player.user.team = prop.value === 2 ? 'red' : 'blue';
}
case 'DT_BasePlayer.m_iHealth':
player.health = prop.value as number;
break;