mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-02 17:57:59 +03:00
Fix lateral movement
This commit is contained in:
parent
534a1bd2b4
commit
3a34300367
1 changed files with 5 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue