Skip to content

Commit 86a1e3d

Browse files
Fixed fixGSIData (for player obs_slot)
Accidentally broke the fixGSIData function in the last update. Seems to be working now.
1 parent 3e94f64 commit 86a1e3d

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "openhud",
33
"private": true,
4-
"version": "3.0.0",
4+
"version": "3.0.1",
55
"type": "module",
66
"main": "dist-electron/main.js",
77
"author": {

src/electron/server/sockets/GSI.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,12 @@ const fixGSIData = (data: CSGORaw) => {
2525
}
2626

2727
if (data.allplayers) {
28-
for (const playerId in data.allplayers) {
29-
if (data.allplayers?.playerId) {
30-
if (data.allplayers[playerId]) {
31-
data.allplayers[playerId].observer_slot =
32-
data.allplayers[playerId].observer_slot === 9
33-
? 0
34-
: (data.allplayers[playerId].observer_slot || 0) + 1;
35-
}
28+
Object.entries(data.allplayers).forEach(([, player]) => {
29+
if (player) {
30+
player.observer_slot =
31+
player.observer_slot === 9 ? 0 : (player.observer_slot || 0) + 1;
3632
}
37-
}
33+
});
3834
}
3935
};
4036

0 commit comments

Comments
 (0)