diff --git a/Server/Components/Vehicles/vehicle.cpp b/Server/Components/Vehicles/vehicle.cpp index b39c7f74d..f91823930 100644 --- a/Server/Components/Vehicles/vehicle.cpp +++ b/Server/Components/Vehicles/vehicle.cpp @@ -809,16 +809,7 @@ void Vehicle::destream() { vehicleData->setVehicle(nullptr, 0); } - - // Related issue: https://github.com/openmultiplayer/open.mp/issues/735 - // Disable spectator's spectating state when spectated vehicle is removed - // This also makes spectateData values to be accurate and not remain with old data - auto spectateData = player->getSpectateData(); - if (spectateData.type == PlayerSpectateData::ESpectateType::Vehicle && spectateData.spectateID == poolID) - { - player->setSpectating(false); - } - + if (isStreamedInForPlayer(*player)) { streamOutForClient(*player); diff --git a/Server/Source/player_impl.hpp b/Server/Source/player_impl.hpp index f7b728652..0a0d12872 100644 --- a/Server/Source/player_impl.hpp +++ b/Server/Source/player_impl.hpp @@ -1672,6 +1672,13 @@ struct Player final : public IPlayer, public PoolIDProvider, public NoCopy pos_ = target.getPosition(); target.streamInForPlayer(*this); + IPlayer* vdriver = target.getDriver(); + // Stream vehicle driver immediately. + if (vdriver != nullptr) + { + vdriver->streamInForPlayer(*this); + } + spectateData_.type = PlayerSpectateData::ESpectateType::Vehicle; spectateData_.spectateID = target.getID();