diff options
author | froggestspirit <froggestspirit@gmail.com> | 2021-09-06 10:32:14 -0400 |
---|---|---|
committer | froggestspirit <froggestspirit@gmail.com> | 2021-09-06 10:32:14 -0400 |
commit | 73554ec88d4f269b6146f6d1ab5d2742cb0a6f89 (patch) | |
tree | fac5bee8a4ce4757816dbbe42265523478b78781 /src/rotating_gate.c | |
parent | ec6b1ea3735ff98a9714b219e4a999894ecc6010 (diff) | |
parent | 63e6b914e4d9b9bdb0a8d621b2ed233990f2ef66 (diff) |
Merge remote-tracking branch 'pret/master'
Diffstat (limited to 'src/rotating_gate.c')
-rw-r--r-- | src/rotating_gate.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/rotating_gate.c b/src/rotating_gate.c index 22a0b0bdf..a185d9a14 100644 --- a/src/rotating_gate.c +++ b/src/rotating_gate.c @@ -670,7 +670,8 @@ static void RotatingGate_RotateInDirection(u8 gateId, u32 rotationDirection) } else { - orientation = ++orientation % GATE_ORIENTATION_MAX; + orientation++; + orientation = orientation % GATE_ORIENTATION_MAX; } RotatingGate_SetGateOrientation(gateId, orientation); } @@ -754,7 +755,7 @@ static u8 RotatingGate_CreateGate(u8 gateId, s16 deltaX, s16 deltaY) sprite->data[0] = gateId; sprite->coordOffsetEnabled = 1; - GetMapCoordsFromSpritePos(x + deltaX, y + deltaY, &sprite->pos1.x, &sprite->pos1.y); + GetMapCoordsFromSpritePos(x + deltaX, y + deltaY, &sprite->x, &sprite->y); RotatingGate_HideGatesOutsideViewport(sprite); StartSpriteAffineAnim(sprite, RotatingGate_GetGateOrientation(gateId)); @@ -799,8 +800,8 @@ static void RotatingGate_HideGatesOutsideViewport(struct Sprite *sprite) s16 x2, y2; sprite->invisible = FALSE; - x = sprite->pos1.x + sprite->pos2.x + sprite->centerToCornerVecX + gSpriteCoordOffsetX; - y = sprite->pos1.y + sprite->pos2.y + sprite->centerToCornerVecY + gSpriteCoordOffsetY; + x = sprite->x + sprite->x2 + sprite->centerToCornerVecX + gSpriteCoordOffsetX; + y = sprite->y + sprite->y2 + sprite->centerToCornerVecY + gSpriteCoordOffsetY; x2 = x + 0x40; // Dimensions of the rotating gate y2 = y + 0x40; |