Remove warnings

This commit is contained in:
Lennart Kampshoff
2019-12-21 13:49:33 +01:00
parent b4f4bb4622
commit c5f72c2ce5
53 changed files with 158 additions and 298 deletions

View File

@@ -745,11 +745,11 @@ namespace ReallifeGamemode.Server.Managers
double distanceDriven;
try
{
distanceDriven = v.HasSharedData("drivenDistance") ? (double)v.GetSharedData("drivenDistance") : 0D;
distanceDriven = v.HasSharedData("drivenDistance") ? (double)v.GetSharedData("drivenDistance") : 0D;
}
catch(Microsoft.CSharp.RuntimeBinder.RuntimeBinderException ex)
catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException)
{
distanceDriven = (double)0;
distanceDriven = 0;
}
double distance = lastPosition.DistanceTo(v.Position) / 1000.0;
@@ -814,11 +814,11 @@ namespace ReallifeGamemode.Server.Managers
public static Vehicle GetVehicleFromId(int id)
{
using(var dbcontext = new DatabaseContext())
using (var dbcontext = new DatabaseContext())
{
ServerVehicle sVeh = dbcontext.ServerVehicles.Where(sV => sV.Id == id).FirstOrDefault();
return GetVehicleFromServerVehicle(sVeh);
}
}
}
public static Vehicle GetVehicleFromServerVehicle(ServerVehicle serverVehicle)
@@ -866,7 +866,7 @@ namespace ReallifeGamemode.Server.Managers
{
ServerVehicle serverVehicle = GetServerVehicleFromVehicle(vehicle);
if(serverVehicle == null)
if (serverVehicle == null)
{
vehicle.Delete();
return;