1
0
mirror of https://github.com/shiroikitsu8/Bayshore_6r_legacy.git synced 2024-12-01 02:27:22 +01:00

Update game.ts

This commit is contained in:
ghkkk090 2022-08-09 09:11:41 +07:00 committed by GitHub
parent 36dbf5e7b0
commit b98b704386
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1175,16 +1175,32 @@ export default class GameModule extends Module {
}
})
// Error handling if windowStickerString is undefined if user registering bannapass from terminal first instead of driver unit
let wsString = "";
let wsFont = 0;
if(user.cars[0].windowStickerString !== null && user.cars[0].windowStickerString !== undefined && user.cars[0].windowStickerString !== ''){
wsString = user.cars[0].windowStickerString;
wsFont = user.cars[0].windowStickerFont;
}
else{
// No car data
if(user.cars.length > 0)
{
wsString = '';
wsFont = 0;
}
// There is car data
else
{
// User atleast have cars
if(user.cars){
if(user.cars[0]?.windowStickerString !== null && user.cars[0]?.windowStickerString !== undefined && user.cars[0]?.windowStickerString !== ''){
wsString = user.cars[0].windowStickerString;
wsFont = user.cars[0].windowStickerFont;
}
}
// User don't have car yet
else{
wsString = '';
wsFont = 0;
}
}
let msg = {
error: wm.wm.protobuf.ErrorCode.ERR_SUCCESS,