Random offset for DefaultGrid every round (#4411)
* Random offset for DefaultGrid every round This is useful to make coders aware of entitycoordinates and mapcoordinates being different and to help spot problems early. It also puts the onus of fixing positioning bugs back onto the original coder rather than someone else if they happen to spot it. * Fix clickable test * Fix entitysystemextensions
This commit is contained in:
@@ -32,7 +32,7 @@ namespace Content.Shared.Spawning
|
||||
in Box2? box = null,
|
||||
SharedBroadphaseSystem? collision = null)
|
||||
{
|
||||
var boxOrDefault = box.GetValueOrDefault(Box2.UnitCentered);
|
||||
var boxOrDefault = box.GetValueOrDefault(Box2.UnitCentered).Translated(coordinates.Position);
|
||||
collision ??= EntitySystem.Get<SharedBroadphaseSystem>();
|
||||
|
||||
foreach (var body in collision.GetCollidingEntities(coordinates.MapId, in boxOrDefault))
|
||||
|
||||
Reference in New Issue
Block a user