Skip to content

Commit

Permalink
Only online players
Browse files Browse the repository at this point in the history
  • Loading branch information
UranusBytes committed Jun 29, 2022
1 parent 272a375 commit 2552b6a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion scripts/classes/DieHardSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,23 @@ export class DieHardSystem{
*/
getActors() {
dieHardLog(false, 'DieHardSystem - getActors');
let onlinePlayers = []
for (let playerId of game.users.keys()) {
if (!(game.users.get(playerId).isGM) && game.users.get(playerId).active) {
onlinePlayers.push(playerId)
}
}
let actors = []
actorList:
for (let actorId of game.actors.keys()) {
let curActor = game.actors.get(actorId);
if(curActor.data.type === 'character') {
actors.push({id: actorId, name: curActor.name})
for (let playerId of onlinePlayers) {
if (curActor.data.permission[playerId] !== undefined) {
actors.push({id: actorId, name: curActor.name})
continue actorList
}
}
}
}
return actors;
Expand Down

0 comments on commit 2552b6a

Please sign in to comment.