revert copy-fix, it broke mutex locked contexts

This commit is contained in:
Lion Kortlepel
2021-03-31 12:15:26 +02:00
parent 56a02f0215
commit d4d773b769
2 changed files with 10 additions and 10 deletions

View File

@@ -339,15 +339,15 @@ int lua_GetCars(lua_State* L) {
auto MaybeClient = GetClient(Engine().Server(), ID);
if (MaybeClient && !MaybeClient.value().expired()) {
auto Client = MaybeClient.value().lock();
TClient::TSetOfVehicleData* VehicleData;
TClient::TSetOfVehicleData VehicleData;
{ // Vehicle Data Lock Scope
auto LockedData = Client->GetAllCars();
VehicleData = LockedData.VehicleData;
VehicleData = *LockedData.VehicleData;
} // End Vehicle Data Lock Scope
if (VehicleData->empty())
if (VehicleData.empty())
return 0;
lua_newtable(L);
for (const auto& v : *VehicleData) {
for (const auto& v : VehicleData) {
lua_pushinteger(L, v.ID());
lua_pushstring(L, v.Data().substr(3).c_str());
lua_settable(L, -3);