Skip to content

Commit

Permalink
Recalculate transition tiles even if current tile already has request…
Browse files Browse the repository at this point in the history
…ed direction
  • Loading branch information
kaczy93 committed Oct 9, 2024
1 parent bfb4d22 commit 2f1bd8d
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions CentrED/Tools/LandBrushTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ private Direction AddTransistion(LandObject lo, Direction direction)
if (currentTransition.Contains(direction))
{
//Current transition has direction that we want, nothing to do
targetTransition = currentTransition;
result = direction;
targetDirection = currentTransition.Direction;
}
else
{
Expand All @@ -179,23 +178,19 @@ private Direction AddTransistion(LandObject lo, Direction direction)
if ((~currentTransition.Direction).Contains(direction))
{
//Current transition has direction that we want, nothing to do
targetTransition = currentTransition;
result = direction;
targetDirection = ~currentTransition.Direction;
}
else
{
//We have to look for transition tile in the opposite direction with inversions
targetDirection = ~(currentTransition.Direction & ~direction);
}
}
if (targetTransition == null)
//Lets try to find transition from current tile brush to our active brush
if (currentTileBrush.TryGetMinimalTransition
(activeBrush.Name, targetDirection, out targetTransition))
{
//Our direction is not in current transition, try find better match
if (currentTileBrush.TryGetMinimalTransition
(activeBrush.Name, targetDirection, out targetTransition))
{
result = targetTransition.Direction;
}
result = targetTransition.Direction;
}
if (targetTransition == null)
{
Expand Down

0 comments on commit 2f1bd8d

Please sign in to comment.