Look at changes

This commit is contained in:
Miloslav Číž 2018-09-11 11:00:27 +02:00
parent c91a59bab8
commit d312cf1497

View file

@ -463,10 +463,20 @@ int main()
colorAddition = -1; colorAddition = -1;
} }
if (editing && editCounter == 0) if (editing)
{ {
changes[changeIndex].mColor = wrap(changes[changeIndex].mColor + colorAddition,SQUARE_COLORS); int16_t heightDiff = changes[changeIndex].mHeight - player.mCamera.height;
editCounter = 4;
if (heightDiff > UNITS_PER_SQUARE / 2)
shearDirection = 1;
else if (heightDiff < -1 * UNITS_PER_SQUARE / 2)
shearDirection = -1;
if (editCounter == 0 && colorAddition != 0)
{
changes[changeIndex].mColor = wrap(changes[changeIndex].mColor + colorAddition,SQUARE_COLORS);
editCounter = 4;
}
} }
editCounter = max(0, editCounter - 1); editCounter = max(0, editCounter - 1);