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:
parent
04fc9b1f76
commit
2cccec390a
2 changed files with 5 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue