Fix lateral movement

This commit is contained in:
Lwmte 2021-11-04 19:24:28 +03:00
parent 534a1bd2b4
commit 3a34300367

View file

@ -600,17 +600,19 @@ void MoveItem(ITEM_INFO* item, short angle, int x, int y)
if (!x && !y)
return;
auto s = phd_sin(angle);
auto c = phd_cos(angle);
if (x != 0)
{
auto s = phd_sin(angle);
auto c = phd_cos(angle);
item->pos.xPos += round(x * s);
item->pos.zPos += round(x * c);
}
if (y != 0)
{
auto s = phd_sin(angle + ANGLE(90));
auto c = phd_cos(angle + ANGLE(90));
item->pos.xPos += round(y * s);
item->pos.zPos += round(y * c);
}