Fix misc bugs (#15314)

This commit is contained in:
Leon Friedrich
2023-04-12 12:18:30 +12:00
committed by GitHub
parent d068c4f36b
commit 21378f6e41
9 changed files with 31 additions and 19 deletions

View File

@@ -67,7 +67,7 @@ public sealed class FloorTileSystem : EntitySystem
var results = _physics.IntersectRay(locationMap.MapId, ray, dir.Length, returnOnFirstHit: true);
canAccessCenter = !results.Any();
}
// if user can access tile center then they can place floor
// otherwise check it isn't blocked by a wall
if (!canAccessCenter)
@@ -117,12 +117,18 @@ public sealed class FloorTileSystem : EntitySystem
}
else if (HasBaseTurf(currentTileDefinition, ContentTileDefinition.SpaceID))
{
if (!_stackSystem.Use(uid, 1, stack))
continue;
args.Handled = true;
if (_netManager.IsClient)
return;
mapGrid = _mapManager.CreateGrid(locationMap.MapId);
var gridXform = Transform(mapGrid.Owner);
_transform.SetWorldPosition(gridXform, locationMap.Position);
location = new EntityCoordinates(mapGrid.Owner, Vector2.Zero);
PlaceAt(args.User, mapGrid, location, _tileDefinitionManager[component.OutputTiles[0]].TileId, component.PlaceTileSound, mapGrid.TileSize / 2f);
args.Handled = true;
return;
}
}