improve house
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user