Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
don't always fallback to blue team
Browse files Browse the repository at this point in the history
  • Loading branch information
icewind1991 committed Mar 8, 2018
1 parent 56442ca commit a1bba89
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/PacketHandler/HL2DMEntityHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ 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) {
if (!player.user.team && (prop.value === 2 || prop.value === 3)) {
player.user.team = prop.value === 2 ? 'red' : 'blue';
}
case 'DT_BasePlayer.m_iHealth':
Expand Down
3 changes: 1 addition & 2 deletions src/tests/data/hl2dm_2v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@
"classes": {},
"name": " eFPS | SourceTV | NA #3",
"steamId": "BOT",
"userId": 2,
"team": "blue"
"userId": 2
},
"23": {
"classes": {},
Expand Down
9 changes: 3 additions & 6 deletions src/tests/data/hl2dm_ffa.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,22 +154,19 @@
"classes": {},
"name": " eFPS | SourceTV | NA #1",
"steamId": "BOT",
"userId": 2,
"team": "blue"
"userId": 2
},
"115": {
"classes": {},
"name": "[VDuS] Carbon",
"steamId": "[U:1:52900516]",
"userId": 115,
"team": "blue"
"userId": 115
},
"116": {
"classes": {},
"name": "SE.Hammarn",
"steamId": "[U:1:10585582]",
"userId": 116,
"team": "blue"
"userId": 116
}
},
"deaths": [
Expand Down

0 comments on commit a1bba89

Please sign in to comment.