Merge branch 'develop' of ssh://development.life-of-german.org:451/log-gtav/reallife-gamemode into develop

This commit is contained in:
michael.reiswich
2021-05-30 14:36:32 +02:00
8 changed files with 53 additions and 51 deletions

View File

@@ -1139,10 +1139,17 @@ namespace ReallifeGamemode.Server.Managers
{
using (var dbContext = new DatabaseContext())
{
Vehicle vehicle = NAPI.Pools.GetAllVehicles().Find(v => v.Id == id);
ServerVehicle sV = vehicle.GetServerVehicle(dbContext);
var items = InventoryManager.GetVehicleItems(vehicle);
if (items.Any())
{
string itemsStr = string.Join(", ", items.Select(i => $"{i.ItemId} (amount: {i.Amount})"));
logger.LogInformation("Vehicle {0} died and lost the items: {1}", sV.Id, itemsStr);
InventoryManager.RemoveAllItemsfromVehicleInventory(vehicle);
}
if (sV is UserVehicle uV)
{
if(vehicle.Class == 14) //boot
@@ -1186,7 +1193,6 @@ namespace ReallifeGamemode.Server.Managers
Vehicle newVeh = sV.Spawn(vehicle);
newVeh.Repair();
}
InventoryManager.RemoveAllItemsfromVehicleInventory(vehicle);
}
}