Skip to content

Commit

Permalink
Fixed Game class playerList method
Browse files Browse the repository at this point in the history
  • Loading branch information
mythicalbro committed Oct 14, 2020
1 parent beeb22e commit e22f74a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ export abstract class Game {
* Get an iterable list of players currently on server.
* @returns Iterable list of Player objects.
*/
public static *playerList(): IterableIterator<Player> {
for (let i = 0; i < GetActivePlayers(); i += 1) {
yield new Player(i);
public static* playerList(): IterableIterator<Player> {
for (const id of GetActivePlayers() as number[]) {
yield new Player(id);
}
}

Expand Down Expand Up @@ -407,6 +407,7 @@ export abstract class Game {
public static playSound(soundFile: string, soundSet: string): void {
Audio.playSound(soundFile, soundSet);
}

/**
* Play music. Same as Audio.playSound
*
Expand Down

0 comments on commit e22f74a

Please sign in to comment.