From 9b8c913502ae53a7cc1d0154f10e6a29b048aa16 Mon Sep 17 00:00:00 2001 From: memetrollsXD Date: Tue, 2 Aug 2022 11:42:03 +0200 Subject: [PATCH] Fallback curIndex on GetAllLineupDataCsReq --- src/server/packets/GetAllLineupDataCsReq.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/server/packets/GetAllLineupDataCsReq.ts b/src/server/packets/GetAllLineupDataCsReq.ts index 08374d4..6ce664d 100644 --- a/src/server/packets/GetAllLineupDataCsReq.ts +++ b/src/server/packets/GetAllLineupDataCsReq.ts @@ -3,7 +3,12 @@ import Packet from "../kcp/Packet"; import Session from "../kcp/Session"; export default async function handle(session: Session, packet: Packet) { - const lineup = session.player.db.lineup; + let lineup = session.player.db.lineup; + if (!lineup.curIndex) { + lineup.curIndex = 0; + session.player.db.lineup.curIndex = 0; + session.player.save(); + } session.send("GetAllLineupDataScRsp", { retcode: 0, curIndex: lineup.curIndex,