diff --git a/Scripts/Chunk.cs b/Scripts/Chunk.cs index 9436fc3..7f175aa 100644 --- a/Scripts/Chunk.cs +++ b/Scripts/Chunk.cs @@ -158,9 +158,6 @@ public class Chunk { swapTo.Moved(); if (swapTo.IsEmpty()) swapTo.ActivateNeighbors(); - - // TODO: - // if either "what" or "swapTo" is empty, re-activate all neighbors of the now empty ones } public override string ToString() { diff --git a/Scripts/Elements/Liquid.cs b/Scripts/Elements/Liquid.cs index f3f61bc..d7b18aa 100644 --- a/Scripts/Elements/Liquid.cs +++ b/Scripts/Elements/Liquid.cs @@ -29,10 +29,10 @@ public abstract class Liquid : Element { else if (Chunk.IsEmpty(Position + randomDirection * VERTICAL_OPPOSITE)) Chunk.Swap(this, Position + randomDirection * VERTICAL_OPPOSITE); - else if (Chunk.IsEmpty(Position + randomDirection)) - Chunk.Swap(this, Position + Vector2I.Right + randomDirection); - else if (Chunk.IsEmpty(Position - randomDirection)) - Chunk.Swap(this, Position + Vector2I.Right + randomDirection * VERTICAL_OPPOSITE); + else if (Chunk.IsEmpty(Position + 2 * randomDirection)) + Chunk.Swap(this, Position + 2 * randomDirection); + else if (Chunk.IsEmpty(Position - 2 * randomDirection * VERTICAL_OPPOSITE)) + Chunk.Swap(this, Position - 2 * randomDirection * VERTICAL_OPPOSITE); } public override void ActivateNeighbors() {