Skip to content

Commit

Permalink
Check driver and passenger sync
Browse files Browse the repository at this point in the history
if the reported vehicle is streamed in
  • Loading branch information
NexiusTailer authored Sep 23, 2024
1 parent 59c91ac commit f53a907
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Server/Components/Vehicles/vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void Vehicle::streamOutForClient(IPlayer& player)

bool Vehicle::updateFromDriverSync(const VehicleDriverSyncPacket& vehicleSync, IPlayer& player)
{
if (respawning)
if (respawning || !streamedFor_.valid(player.getID()))
{
return false;
}
Expand Down Expand Up @@ -381,6 +381,11 @@ bool Vehicle::updateFromTrailerSync(const VehicleTrailerSyncPacket& trailerSync,

bool Vehicle::updateFromPassengerSync(const VehiclePassengerSyncPacket& passengerSync, IPlayer& player)
{
if (!streamedFor_.valid(player.getID()))
{
return false;
}

PlayerVehicleData* data = queryExtension<PlayerVehicleData>(player);
if (!data)
{
Expand Down

0 comments on commit f53a907

Please sign in to comment.