Construction warning cleanup (#12256)
This commit is contained in:
@@ -27,9 +27,9 @@ namespace Content.Shared.Construction.Conditions
|
||||
return result;
|
||||
}
|
||||
|
||||
public ConstructionGuideEntry? GenerateGuideEntry()
|
||||
public ConstructionGuideEntry GenerateGuideEntry()
|
||||
{
|
||||
return new ConstructionGuideEntry()
|
||||
return new ConstructionGuideEntry
|
||||
{
|
||||
Localization = "construction-guide-condition-empty-or-window-valid-in-tile"
|
||||
};
|
||||
|
||||
@@ -22,9 +22,9 @@ namespace Content.Shared.Construction.Conditions
|
||||
return true;
|
||||
}
|
||||
|
||||
public ConstructionGuideEntry? GenerateGuideEntry()
|
||||
public ConstructionGuideEntry GenerateGuideEntry()
|
||||
{
|
||||
return new ConstructionGuideEntry()
|
||||
return new ConstructionGuideEntry
|
||||
{
|
||||
Localization = "construction-step-condition-no-windows-in-tile"
|
||||
};
|
||||
|
||||
@@ -21,9 +21,9 @@ namespace Content.Shared.Construction.Conditions
|
||||
return !tileRef.Value.IsBlockedTurf(_filterMobs);
|
||||
}
|
||||
|
||||
public ConstructionGuideEntry? GenerateGuideEntry()
|
||||
public ConstructionGuideEntry GenerateGuideEntry()
|
||||
{
|
||||
return new ConstructionGuideEntry()
|
||||
return new ConstructionGuideEntry
|
||||
{
|
||||
Localization = "construction-step-condition-tile-not-blocked",
|
||||
};
|
||||
|
||||
@@ -13,15 +13,13 @@ namespace Content.Shared.Construction.Conditions
|
||||
public List<string> TargetTiles { get; } = new();
|
||||
|
||||
[DataField("guideText")]
|
||||
public string? GuideText = null;
|
||||
public string? GuideText;
|
||||
|
||||
[DataField("guideIcon")]
|
||||
public SpriteSpecifier? GuideIcon = null;
|
||||
public SpriteSpecifier? GuideIcon;
|
||||
|
||||
public bool Condition(EntityUid user, EntityCoordinates location, Direction direction)
|
||||
{
|
||||
if (TargetTiles == null) return true;
|
||||
|
||||
var tileFound = location.GetTileRef();
|
||||
|
||||
if (tileFound == null)
|
||||
@@ -30,9 +28,8 @@ namespace Content.Shared.Construction.Conditions
|
||||
var tile = tileFound.Value.Tile.GetContentTileDefinition();
|
||||
foreach (var targetTile in TargetTiles)
|
||||
{
|
||||
if (tile.ID == targetTile) {
|
||||
if (tile.ID == targetTile)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Content.Shared.Construction.Conditions
|
||||
// check that we didn't try to build wallmount that facing another adjacent wall
|
||||
var rAdjWall = new CollisionRay(objWorldPosition, directionWithOffset.Normalized, (int) CollisionGroup.Impassable);
|
||||
var adjWallRaycastResults = physics.IntersectRayWithPredicate(entManager.GetComponent<TransformComponent>(user).MapID, rAdjWall, maxLength: 0.5f,
|
||||
predicate: (e) => e == targetWall.Value.HitEntity || !tagSystem.HasTag(e, "Wall"));
|
||||
predicate: e => e == targetWall.Value.HitEntity || !tagSystem.HasTag(e, "Wall"));
|
||||
|
||||
return !adjWallRaycastResults.Any();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user