Skip to content

Commit

Permalink
Merge pull request RSDKModding#258 from Mefiresu/fix-buggernaut-onewa…
Browse files Browse the repository at this point in the history
…ydoor

Misc accuracy bugfixes
  • Loading branch information
stxticOVFL committed Nov 20, 2023
2 parents c296945 + c4f4425 commit c417cca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions SonicMania/Objects/CPZ/OneWayDoor.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ void OneWayDoor_HandlePlayerInteractions(void)
OneWayDoor->hitboxRange.left = -88;

if (Player_CheckCollisionTouch(currentPlayer, self, &OneWayDoor->hitboxRange)) {
#if MANIA_USE_PLUS
if (isMMZ1 && currentPlayer->sidekick && !isBehind) {
#if MANIA_USE_PLUS
Player->cantSwap = true;
NoSwap->counter++;
#endif
}
else
#endif
self->state = OneWayDoor_State_MoveUp;
}
}
Expand Down
10 changes: 4 additions & 6 deletions SonicMania/Objects/HCZ/Buggernaut.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,7 @@ void Buggernaut_State_Child(void)
self->position.x += self->velocity.x;
self->position.y += self->velocity.y;

EntityBuggernaut *parent = self->parent;
if (!parent || parent->classID != Buggernaut->classID) {
self->parent = NULL;
if (!self->parent || self->parent->classID != Buggernaut->classID) {
foreach_active(Buggernaut, buggernaut)
{
if (buggernaut->bodyAnimator.animationID == 0
Expand All @@ -322,7 +320,7 @@ void Buggernaut_State_Child(void)
}

if (self->parent) {
if (parent->position.x >= self->position.x) {
if (self->parent->position.x >= self->position.x) {
self->velocity.x += 0x2000;

if (self->velocity.x > 0x20000)
Expand All @@ -339,7 +337,7 @@ void Buggernaut_State_Child(void)
self->direction = FLIP_NONE;
}

if (parent->position.y >= self->position.y) {
if (self->parent->position.y >= self->position.y) {
self->velocity.y += 0x2000;

if (self->velocity.y > 0x20000)
Expand Down Expand Up @@ -368,7 +366,7 @@ void Buggernaut_State_Child(void)

RSDK.ProcessAnimation(&self->wingAnimator);

if (parent->state == Buggernaut_State_Init)
if (self->parent->state == Buggernaut_State_Init)
destroyEntity(self);
}

Expand Down

0 comments on commit c417cca

Please sign in to comment.