Add Radius for Doors and Gates
This commit is contained in:
@@ -24,6 +24,7 @@ namespace reallife_gamemode.Server.Entities
|
|||||||
public float X { get; set; }
|
public float X { get; set; }
|
||||||
public float Y { get; set; }
|
public float Y { get; set; }
|
||||||
public float Z { get; set; }
|
public float Z { get; set; }
|
||||||
|
public float Radius { get; set; }
|
||||||
|
|
||||||
[ForeignKey("FactionId")]
|
[ForeignKey("FactionId")]
|
||||||
public int? FactionId { get; set; }
|
public int? FactionId { get; set; }
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace reallife_gamemode.Server.Managers
|
|||||||
|
|
||||||
using (var saveDoor = new DatabaseContext())
|
using (var saveDoor = new DatabaseContext())
|
||||||
{
|
{
|
||||||
NearDoors = saveDoor.Doors.ToList().FindAll(d => new Vector3(d.X, d.Y, d.Z).DistanceTo(player.Position) <= 2);
|
NearDoors = saveDoor.Doors.ToList().FindAll(d => new Vector3(d.X, d.Y, d.Z).DistanceTo(player.Position) <= d.Radius);
|
||||||
foreach (Door d in NearDoors)
|
foreach (Door d in NearDoors)
|
||||||
{
|
{
|
||||||
Door currentDoor = saveDoor.Doors.FirstOrDefault(c => c.Id == d.Id);
|
Door currentDoor = saveDoor.Doors.FirstOrDefault(c => c.Id == d.Id);
|
||||||
|
|||||||
Reference in New Issue
Block a user