mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-04 04:48:15 +03:00
Add an extra case in set rivals for empty rival list (#1667)
This commit is contained in:
@@ -95,6 +95,17 @@ export async function setRivalsWithResult(
|
||||
game: V3Game,
|
||||
newRivals: Array<integer>,
|
||||
): Promise<SetRivalsFailReasons | null> {
|
||||
if (newRivals.length === 0) {
|
||||
await DB.deleteFrom("game_rival")
|
||||
.where("user_id", "=", userID)
|
||||
.where("game", "=", game)
|
||||
.execute();
|
||||
|
||||
await UpdatePlayersRivalRankings(userID, game);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
if (newRivals.length > ServerConfig.MAX_RIVALS) {
|
||||
return SetRivalsFailReasons.TOO_MANY;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user