Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix large wall mount clipping (#1347) #1433

Merged
merged 3 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4584c35d672b8a74797cc5efa123ce16, type: 3}
m_Name: APC
m_EditorClassIdentifier:
nameString: apc
prefab: {fileID: 5287103069661579500, guid: 4c966398d6624164c910cd29c1faa980, type: 3}
icon: {fileID: 0}
layer: 6
genericType: 0
specificType: 0
width: 1
height: 1
isLarge: 1
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4584c35d672b8a74797cc5efa123ce16, type: 3}
m_Name: AirAlarm
m_EditorClassIdentifier:
nameString: airalarm
prefab: {fileID: 6961426338783081091, guid: 11a2276338ebc64429dfc565b491e437, type: 3}
icon: {fileID: 0}
layer: 6
genericType: 0
specificType: 0
width: 1
height: 1
isLarge: 1
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4584c35d672b8a74797cc5efa123ce16, type: 3}
m_Name: FireAlarm
m_EditorClassIdentifier:
nameString: firealarm
prefab: {fileID: 4866668043303595546, guid: 50dd6be959d44844ab1abf8a3f2adb01, type: 3}
icon: {fileID: 0}
layer: 6
genericType: 0
specificType: 0
width: 1
height: 1
isLarge: 1
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4584c35d672b8a74797cc5efa123ce16, type: 3}
m_Name: Mirror
m_EditorClassIdentifier:
nameString: mirror
prefab: {fileID: 4866668043303595546, guid: a777a6da30f0704478e25312963a8151, type: 3}
icon: {fileID: 21300000, guid: 9e89894392ee65f45bd559d4619cbade, type: 3}
layer: 6
genericType: 0
specificType: 0
width: 1
height: 1
isLarge: 1
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4584c35d672b8a74797cc5efa123ce16, type: 3}
m_Name: PosterHorizontal
m_EditorClassIdentifier:
nameString: poster_horizontal
prefab: {fileID: 5161561551087789900, guid: fdaaabc96a55d824a86a3636906240c1, type: 3}
icon: {fileID: 0}
layer: 6
genericType: 0
specificType: 0
width: 1
height: 1
isLarge: 1
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4584c35d672b8a74797cc5efa123ce16, type: 3}
m_Name: PosterVertical
m_EditorClassIdentifier:
nameString: poster_vertical
prefab: {fileID: 5927714388255546572, guid: 0d6ab6288624c7348bdcbfb81d07088f, type: 3}
icon: {fileID: 0}
layer: 6
genericType: 0
specificType: 0
width: 1
height: 1
isLarge: 1
4 changes: 4 additions & 0 deletions Assets/Scripts/SS3D/Systems/Tile/BuildChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ public static bool CanBuild(ITileLocation[] tileLocations, TileObjectSo tileObje
case TileLayer.WallMountHigh when canBuild:
case TileLayer.WallMountLow when canBuild:
{
// If a wall mount is large, check to see if there are other large wall mounts
canBuild &= !(tileObjectSo.isLarge && !tileLocations[(int)placedLayer].IsEmpty(TileHelper.GetNextCardinalDir(dir)));
canBuild &= !(tileObjectSo.isLarge && !tileLocations[(int)placedLayer].IsEmpty(TileHelper.GetPreviousCardinalDir(dir)));

canBuild &= CanBuildWallAttachment((SingleTileLocation) tileLocations[(int)TileLayer.Turf],
tileObjectSo, dir, adjacentObjects);
break;
Expand Down
3 changes: 3 additions & 0 deletions Assets/Scripts/SS3D/Systems/Tile/SO/TileObjectSo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public class TileObjectSo : GenericObjectSo
public int width = 1;
public int height = 1;

// Whether or not a wall mount is large
public bool isLarge;

/// <summary>
/// TODO : document and understand properly this method. Why the diagonal directions are not treated ?
/// </summary>
Expand Down
Loading