From 6c5b8547b444483e0400efbd7a0ddfd24f822046 Mon Sep 17 00:00:00 2001 From: Jengas Date: Thu, 5 Sep 2024 12:19:04 +0400 Subject: [PATCH] fix: push mp players instead of alt players (#38) (#39) Co-authored-by: Vadim Zubkov --- bindings/src/server/entities/Vehicle.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bindings/src/server/entities/Vehicle.js b/bindings/src/server/entities/Vehicle.js index b8d802e..1b5b8a1 100644 --- a/bindings/src/server/entities/Vehicle.js +++ b/bindings/src/server/entities/Vehicle.js @@ -400,7 +400,7 @@ alt.on('playerEnteredVehicle', (player, vehicle, seat) => { vehicle.mp.__occupantsMap = occupants; } - occupants.set(altSeatToMp(seat), player); + occupants.set(altSeatToMp(seat), player.mp); }); alt.on('playerLeftVehicle', (player, vehicle, seat) => { @@ -411,7 +411,7 @@ alt.on('playerLeftVehicle', (player, vehicle, seat) => { } occupants.forEach((p, s) => { - if (p === player) { + if (p === player.mp) { occupants.delete(s); } }); @@ -425,7 +425,7 @@ alt.on('playerChangedVehicleSeat', (player, vehicle, oldSeat, newSeat) => { } occupants.delete(altSeatToMp(oldSeat)); - occupants.set(altSeatToMp(newSeat), player); + occupants.set(altSeatToMp(newSeat), player.mp); }); alt.on('removeEntity', (entity) => {