Increased range for entities to solve this, instead of checking the client bounding box
This commit is contained in:
parent
5c1512d527
commit
6a8cd691a6
@ -131,7 +131,7 @@ namespace TrueCraft.Core.Logic
|
||||
{
|
||||
// Test for entities
|
||||
var em = user.Server.GetEntityManagerForWorld(world);
|
||||
var entities = em.EntitiesInRange(coordinates, 1);
|
||||
var entities = em.EntitiesInRange(coordinates, 2);
|
||||
var box = new BoundingBox(coordinates, coordinates + Vector3.One);
|
||||
foreach (var entity in entities)
|
||||
{
|
||||
@ -150,15 +150,6 @@ namespace TrueCraft.Core.Logic
|
||||
}
|
||||
}
|
||||
|
||||
// Prevent the user from placing blocks on themselves
|
||||
var userPlayer = user.Entity as PlayerEntity;
|
||||
if (userPlayer != null){
|
||||
if (new BoundingBox(userPlayer.Position, userPlayer.Position + userPlayer.Size)
|
||||
.Intersects(box)){
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Place block
|
||||
world.SetBlockID(coordinates, ID);
|
||||
world.SetMetadata(coordinates, (byte)item.Metadata);
|
||||
|
Reference in New Issue
Block a user