File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import (
13
13
"fmt"
14
14
"log"
15
15
"math"
16
- "slices"
17
16
"time"
18
17
)
19
18
@@ -143,7 +142,7 @@ func (game *Game) AddPlayer(userId int, password string) {
143
142
func (game * Game ) RemovePlayer (userId int ) {
144
143
user := sessions .GetUserById (userId )
145
144
146
- var playerWasInMatch = slices . Contains (game .playersInMatch , userId )
145
+ var playerWasInMatch = utils . Includes (game .playersInMatch , userId )
147
146
148
147
if user != nil {
149
148
user .SetMultiplayerGameId (0 )
@@ -1138,7 +1137,7 @@ func (game *Game) isAllPlayersFinished() bool {
1138
1137
}
1139
1138
1140
1139
func (game * Game ) isPlayerSpectatorOrReferee (userId int ) bool {
1141
- return game .Data .RefereeId == userId || slices . Contains (game .spectators , userId )
1140
+ return game .Data .RefereeId == userId || utils . Includes (game .spectators , userId )
1142
1141
}
1143
1142
1144
1143
// Checks if all the players in the game have skipped the map and sends a packet letting them know.
@@ -1195,7 +1194,7 @@ func (game *Game) sendPacketToPlayers(packet interface{}) {
1195
1194
1196
1195
for _ , id := range game .spectators {
1197
1196
// Referee will have already gotten the packet above.
1198
- if id == game .Data .RefereeId && slices . Contains (game .Data .PlayerIds , id ) {
1197
+ if id == game .Data .RefereeId && utils . Includes (game .Data .PlayerIds , id ) {
1199
1198
continue
1200
1199
}
1201
1200
You can’t perform that action at this time.
0 commit comments