Skip to content

Commit

Permalink
fix(client/vehicle): early-return when entity doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Jul 11, 2024
1 parent f01ac11 commit 577f35f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/vehicle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ AddStateBagChangeHandler('vehicleProperties', '', async (bagName: string, key: s

// properties and serverside vehicles are one of the most retarded features of fivem
// let's set this dumb bullshit in an interval and see if they actually bother setting
await new Promise((resolve) => {
const resolved = await new Promise((resolve) => {
let i = 0;
let interval: CitizenTimer;

Expand All @@ -93,6 +93,8 @@ AddStateBagChangeHandler('vehicleProperties', '', async (bagName: string, key: s
}, 100);
});

if (!resolved) return;

const properties = getVehicleProperties(entity);

if (!doesfivemworkyet(value, properties))
Expand Down

0 comments on commit 577f35f

Please sign in to comment.