Skip to content

Commit

Permalink
improve snow cleanning
Browse files Browse the repository at this point in the history
  • Loading branch information
MixelTe committed Dec 7, 2022
1 parent 414f7bd commit 858a74c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Snowdrifts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,14 @@ public void Update(long deltaTime, Point? cursorForce)
if (_pieces[i] >= h - Program.Settings.ForcePower)
{
var nv = h - Program.Settings.ForcePower * ((m - Math.Abs(i - ic) + 0f) / m);
if (nv < _pieces[i]) _pieces[i] = nv;
if (nv < _pieces[i])
{
var v = _pieces[i] - Program.Settings.ForcePower / 2;
if (v > nv)
_pieces[i] = v;
else
_pieces[i] = nv;
}
if (_pieces[i] < 0) _pieces[i] = 0;
}
i++;
Expand Down

0 comments on commit 858a74c

Please sign in to comment.