1
0
mirror of synced 2024-11-12 01:10:47 +01:00

fix stamp sheet bug not reset after full, and gt wing equip saving after reaching lvl 65

This commit is contained in:
Shiroi Kitsu 2022-12-25 16:23:24 +07:00
parent ad677d92a2
commit b3a96a88b6

View File

@ -28,6 +28,7 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
// Declare data // Declare data
let dataGhost : any; let dataGhost : any;
let dataCar : any; let dataCar : any;
let dataCarGTWing: any;
// Get the ghost result for the car // Get the ghost result for the car
let cars = body?.car; let cars = body?.car;
@ -63,6 +64,18 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
plateNumber: common.sanitizeInput(cars.plateNumber), plateNumber: common.sanitizeInput(cars.plateNumber),
ghostLevel: common.sanitizeInput(cars.ghostLevel), ghostLevel: common.sanitizeInput(cars.ghostLevel),
} }
if(cars.gtWing)
{
dataCarGTWing = {
pillar: common.sanitizeInput(cars.gtWing.pillar),
pillarMaterial: common.sanitizeInput(cars.gtWing.pillarMaterial),
mainWing: common.sanitizeInput(cars.gtWing.mainWing),
mainWingColor: common.sanitizeInput(cars.gtWing.mainWingColor),
wingTip: common.sanitizeInput(cars.gtWing.wingTip),
material: common.sanitizeInput(cars.gtWing.material),
}
}
} }
// Get the ghost result for the car // Get the ghost result for the car
@ -72,7 +85,15 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
if (ghostResult) if (ghostResult)
{ {
let stampSheet: any = undefined; let stampSheet: any = undefined;
if(ghostResult.stampSheet!.length > 0) if(ghostResult.stampSheet!.length === 0)
{
if(ghostResult.stampSheetCount !== null && ghostResult.stampSheetCount !== undefined && ghostResult.stampSheetCount !== 0)
{
stampSheet = ghostResult.stampSheet;
}
}
// Stamp Sheet available
else if(ghostResult.stampSheet!.length > 0)
{ {
stampSheet = ghostResult.stampSheet; stampSheet = ghostResult.stampSheet;
} }
@ -112,7 +133,8 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
}, },
data: { data: {
...dataGhost, ...dataGhost,
...dataCar ...dataCar,
...dataCarGTWing,
} }
}); });