mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-08-16 08:16:09 +00:00
add back car deletion
This commit is contained in:
parent
0cc73e70c9
commit
3068a0e5c4
@ -657,6 +657,8 @@ void TNetwork::OnDisconnect(const std::weak_ptr<TClient>& ClientPtr) {
|
||||
} // End Vehicle Data Lock Scope
|
||||
for (auto& v : VehicleData) {
|
||||
LuaAPI::MP::Engine->ReportErrors(LuaAPI::MP::Engine->TriggerEvent("onVehicleDeleted", "", c.GetID(), v.ID()));
|
||||
Packet = "Od:" + std::to_string(c.GetID()) + "-" + std::to_string(v.ID());
|
||||
SendToAll(&c, StringToVector(Packet), false, true);
|
||||
}
|
||||
Packet = ("L") + c.GetName() + (" left the server!");
|
||||
SendToAll(&c, StringToVector(Packet), false, true);
|
||||
|
@ -137,7 +137,6 @@ void TServer::RemoveClient(const std::weak_ptr<TClient>& WeakClientPtr) {
|
||||
beammp_assert(LockedClientPtr != nullptr);
|
||||
TClient& Client = *LockedClientPtr;
|
||||
beammp_debug("removing client " + Client.GetName() + " (" + std::to_string(ClientCount()) + ")");
|
||||
// TODO: Send delete packets for all cars
|
||||
Client.ClearCars();
|
||||
WriteLock Lock(mClientsMutex);
|
||||
mClients.erase(WeakClientPtr.lock());
|
||||
|
Loading…
x
Reference in New Issue
Block a user