add option to park vehicles in vehicle menu
This commit is contained in:
@@ -162,27 +162,13 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
public static ServerVehicle GetServerVehicleFromVehicle(Vehicle veh, DatabaseContext dbContext = null)
|
||||
{
|
||||
if (dbContext == null)
|
||||
dbContext = dbContext ?? new DatabaseContext();
|
||||
|
||||
foreach (KeyValuePair<int, NetHandle> pair in _serverVehicles)
|
||||
{
|
||||
using (dbContext = new DatabaseContext())
|
||||
if (pair.Value == veh.Handle)
|
||||
{
|
||||
foreach (KeyValuePair<int, NetHandle> pair in _serverVehicles)
|
||||
{
|
||||
if (pair.Value == veh.Handle)
|
||||
{
|
||||
return dbContext.ServerVehicles.Find(pair.Key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (KeyValuePair<int, NetHandle> pair in _serverVehicles)
|
||||
{
|
||||
if (pair.Value == veh.Handle)
|
||||
{
|
||||
return dbContext.ServerVehicles.Find(pair.Key);
|
||||
}
|
||||
return dbContext.ServerVehicles.Find(pair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user