fix no wing bug
This commit is contained in:
parent
f6ec738d2a
commit
92e0a23c30
@ -556,6 +556,7 @@ export default class CarModule extends Module {
|
||||
|
||||
// Get the request body for the update car request
|
||||
let body = wm.wm.protobuf.UpdateCarRequest.decode(req.body);
|
||||
console.log(body);
|
||||
|
||||
// Get the ghost result for the car
|
||||
let cars = body?.car;
|
||||
@ -672,11 +673,12 @@ export default class CarModule extends Module {
|
||||
// Update the GT Wing (custom wing) info
|
||||
// Get the GT Wing data for the car
|
||||
let gtWing = body.car?.gtWing;
|
||||
let dataGTWing: any;
|
||||
|
||||
// GT Wing is set
|
||||
if (gtWing)
|
||||
{
|
||||
let dataGTWing : any = {
|
||||
dataGTWing = {
|
||||
pillar: common.sanitizeInput(gtWing.pillar),
|
||||
pillarMaterial: common.sanitizeInput(gtWing.pillarMaterial),
|
||||
mainWing: common.sanitizeInput(gtWing.mainWing),
|
||||
@ -684,14 +686,25 @@ export default class CarModule extends Module {
|
||||
wingTip: common.sanitizeInput(gtWing.wingTip),
|
||||
material: common.sanitizeInput(gtWing.material),
|
||||
}
|
||||
|
||||
await prisma.carGTWing.update({
|
||||
where: {
|
||||
dbId: body.carId
|
||||
},
|
||||
data: dataGTWing
|
||||
})
|
||||
}
|
||||
else
|
||||
{
|
||||
dataGTWing = {
|
||||
pillar: 0,
|
||||
pillarMaterial: 0,
|
||||
mainWing: 0,
|
||||
mainWingColor: 0,
|
||||
wingTip: 0,
|
||||
material: 0,
|
||||
}
|
||||
}
|
||||
|
||||
await prisma.carGTWing.update({
|
||||
where: {
|
||||
dbId: body.carId
|
||||
},
|
||||
data: dataGTWing
|
||||
})
|
||||
|
||||
// Response data
|
||||
let msg = {
|
||||
|
@ -9,8 +9,6 @@ import * as ghost_get_area_from_path from "../ghost/ghost_util/ghost_get_area_fr
|
||||
|
||||
export async function sendStamp(body: wm.protobuf.SaveGameResultRequest)
|
||||
{
|
||||
let consoleLog = 0; // stupid stuff for console log notice
|
||||
|
||||
let rgResult = body.rgResult;
|
||||
|
||||
// Get current date
|
||||
@ -51,10 +49,9 @@ export async function sendStamp(body: wm.protobuf.SaveGameResultRequest)
|
||||
|
||||
if(checkCar)
|
||||
{
|
||||
if(consoleLog === 0)
|
||||
if(i === 0)
|
||||
{
|
||||
console.log('Sending Stamp');
|
||||
consoleLog = 1;
|
||||
}
|
||||
|
||||
// Create Challenger data
|
||||
@ -71,7 +68,7 @@ export async function sendStamp(body: wm.protobuf.SaveGameResultRequest)
|
||||
let dataStampTarget: any = {
|
||||
carId: body.carId,
|
||||
stampTargetCarId: rgResult.opponents![i].carId,
|
||||
returnCount: 1,
|
||||
returnCount: 0,
|
||||
locked: false,
|
||||
recommended: true
|
||||
}
|
||||
@ -105,8 +102,6 @@ export async function sendStamp(body: wm.protobuf.SaveGameResultRequest)
|
||||
|
||||
export async function shuttleReturnStamp(body: wm.protobuf.SaveGameResultRequest)
|
||||
{
|
||||
let consoleLog = 0; // stupid stuff for console log notice
|
||||
|
||||
let rgResult = body.rgResult;
|
||||
|
||||
// Get current date
|
||||
@ -147,10 +142,9 @@ export async function shuttleReturnStamp(body: wm.protobuf.SaveGameResultRequest
|
||||
|
||||
if(checkCar)
|
||||
{
|
||||
if(consoleLog === 0)
|
||||
if(i === 0)
|
||||
{
|
||||
console.log('Returning Stamp');
|
||||
consoleLog = 1;
|
||||
}
|
||||
|
||||
// Return the stamp
|
||||
|
Loading…
Reference in New Issue
Block a user