improve house

This commit is contained in:
hydrant
2020-03-29 17:40:35 +02:00
parent 1871a97122
commit 0dc1235909
2 changed files with 4 additions and 13 deletions

View File

@@ -176,7 +176,7 @@ namespace ReallifeGamemode.Server.Core.Managers
public House GetNearHouse(Position position, DatabaseContext dbContext)
{
return dbContext.Houses.Where(h => h.NewPosition.DistanceTo(position) <= 5f).Include(h => h.Owner).OrderBy(h => h.NewPosition.DistanceTo(position)).FirstOrDefault();
return dbContext.Houses.Where(h => h.Position.DistanceTo(position) <= 5f).Include(h => h.Owner).OrderBy(h => h.Position.DistanceTo(position)).FirstOrDefault();
}
public void ReloadAllHouses()
@@ -337,7 +337,7 @@ namespace ReallifeGamemode.Server.Core.Managers
player.SendNotification("~g~Du hast dich in das Haus eingemietet");
house.OwnerPlayer?.SendNotification($"~y~{player.Name}~s~ hat sich in dein Haus eingemietet.");
house.Owner?.NewPlayer?.SendNotification($"~y~{player.Name}~s~ hat sich in dein Haus eingemietet.");
SendPlayerHouseData(player, house);
}
@@ -366,7 +366,7 @@ namespace ReallifeGamemode.Server.Core.Managers
dbContext.SaveChanges();
player.SendNotification("~g~Du hast den Mietvertrag gekündigt.");
house.OwnerPlayer?.SendNotification($"~y~{player.Name}~s~ hat seinen Mietvertrag gekündigt.");
house.Owner?.NewPlayer?.SendNotification($"~y~{player.Name}~s~ hat seinen Mietvertrag gekündigt.");
RemoveHouse(house);
LoadHouse(house);