formatted code
This commit is contained in:
@@ -31,10 +31,10 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
colShape.OnEntityEnterColShape += (cs, c) =>
|
||||
{
|
||||
if(c.IsInVehicle)
|
||||
if (c.IsInVehicle)
|
||||
{
|
||||
Vehicle v = c.Vehicle;
|
||||
if(v.GetServerVehicle() is FactionVehicle fV && fV.GetFaction().StateOwned)
|
||||
if (v.GetServerVehicle() is FactionVehicle fV && fV.GetFaction().StateOwned)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -60,13 +60,13 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
foreach(VehicleMod vMod in dbContext.VehicleMods.ToList().FindAll(vM => vM.ServerVehicleId == sVeh.Id))
|
||||
foreach (VehicleMod vMod in dbContext.VehicleMods.ToList().FindAll(vM => vM.ServerVehicleId == sVeh.Id))
|
||||
{
|
||||
if(vMod.Slot == 18)
|
||||
if (vMod.Slot == 18)
|
||||
{
|
||||
veh.SetSharedData("mod" + vMod.Slot, true);
|
||||
}
|
||||
else if(vMod.Slot == 22)
|
||||
else if (vMod.Slot == 22)
|
||||
{
|
||||
int color = vMod.ModId - 2;
|
||||
if (vMod.ModId == 0) color = -1;
|
||||
@@ -99,9 +99,9 @@ namespace ReallifeGamemode.Server.Managers
|
||||
Vehicle pV = player.Vehicle;
|
||||
if (index == 0) index--;
|
||||
|
||||
if(slot != 18)
|
||||
if (slot != 18)
|
||||
{
|
||||
if(slot == 22)
|
||||
if (slot == 22)
|
||||
{
|
||||
int color = index - 2;
|
||||
if (index == 0) color = -1;
|
||||
@@ -126,7 +126,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
VehicleMod vMod = dbContext.VehicleMods.FirstOrDefault(m => m.ServerVehicleId == sV.Id && m.Slot == slot);
|
||||
if(vMod == null && index != -1)
|
||||
if (vMod == null && index != -1)
|
||||
{
|
||||
vMod = new VehicleMod
|
||||
{
|
||||
@@ -136,7 +136,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
};
|
||||
dbContext.VehicleMods.Add(vMod);
|
||||
}
|
||||
else if(vMod != null && index == -1)
|
||||
else if (vMod != null && index == -1)
|
||||
{
|
||||
dbContext.VehicleMods.Remove(vMod);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user