Fallback curIndex on GetAllLineupDataCsReq

This commit is contained in:
memetrollsXD 2022-08-02 11:42:03 +02:00
parent b951c00e65
commit 9b8c913502
No known key found for this signature in database
GPG Key ID: 105C2F3417AC32CD

View File

@ -3,7 +3,12 @@ import Packet from "../kcp/Packet";
import Session from "../kcp/Session"; import Session from "../kcp/Session";
export default async function handle(session: Session, packet: Packet) { 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", { session.send("GetAllLineupDataScRsp", {
retcode: 0, retcode: 0,
curIndex: lineup.curIndex, curIndex: lineup.curIndex,