Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove SyncPlayerToPlatform fake match #667

Merged
merged 2 commits into from
Dec 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 44 additions & 44 deletions src/objectUtils.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,50 +267,50 @@ void CreateSparkle(Entity* entity) {
}

void SyncPlayerToPlatform(Entity* this, bool32 param_2) {
s16 oldValue;
s32 diff;
u16 newValue;
FORCE_REGISTER(Entity * that, r4) = this;
FORCE_REGISTER(bool32 p2, r6) = param_2;
u16 dir = that->direction;

if ((dir & 0x80) == 0) {
switch (dir >> 3) {
case 0:
oldValue = that->y.HALF_U.HI;
LinearMoveUpdate(that);
newValue = that->y.HALF_U.HI;
diff = ((oldValue - newValue) << 0x10) >> 0x10;
if ((diff != 0) && (p2 != 0)) {
sub_080044AE(&gPlayerEntity, diff << 8, 0);
}
break;
case 1:
oldValue = that->x.HALF_U.HI;
LinearMoveUpdate(that);
diff = ((that->x.HALF_U.HI - oldValue) * 0x10000) >> 0x10;
if ((diff != 0) && (p2 != 0)) {
sub_080044AE(&gPlayerEntity, diff << 8, 8);
}
break;
case 2:
oldValue = that->y.HALF_U.HI;
LinearMoveUpdate(that);
diff = ((that->y.HALF_U.HI - oldValue) * 0x10000) >> 0x10;
if ((diff != 0) && (p2 != 0)) {
sub_080044AE(&gPlayerEntity, diff << 8, 0x10);
}
break;
case 3:
oldValue = that->x.HALF_U.HI;
LinearMoveUpdate(that);
newValue = that->x.HALF_U.HI;
diff = ((oldValue - newValue) << 0x10) >> 0x10;
if ((diff != 0) && (p2 != 0)) {
sub_080044AE(&gPlayerEntity, diff << 8, 0x18);
}
break;
}
s16 oldValue1, oldValue2;
s32 newValue1, newValue2, newValue3, newValue4;
s16 diff;

if ((this->direction & 0x80) != 0)
return;

switch (this->direction >> 3) {
case 0:
oldValue1 = this->y.HALF_U.HI;
LinearMoveUpdate(this);
newValue1 = this->y.HALF_U.HI;
diff = ((oldValue1 - newValue1));
if ((diff != 0) && (param_2 != 0)) {
sub_080044AE(&gPlayerEntity, diff << 8, 0);
}
break;
case 1:
oldValue2 = this->x.HALF_U.HI;
LinearMoveUpdate(this);
newValue2 = this->x.HALF_U.HI;
diff = (newValue2 - oldValue2);
if ((diff != 0) && (param_2 != 0)) {
sub_080044AE(&gPlayerEntity, diff << 8, 8);
}
break;
case 2:
oldValue2 = this->y.HALF_U.HI;
LinearMoveUpdate(this);
newValue3 = this->y.HALF_U.HI;
diff = (newValue3 - oldValue2);
if ((diff != 0) && (param_2 != 0)) {
sub_080044AE(&gPlayerEntity, diff << 8, 0x10);
}
break;
case 3:
oldValue1 = this->x.HALF_U.HI;
LinearMoveUpdate(this);
newValue4 = this->x.HALF_U.HI;
diff = ((oldValue1 - newValue4));
if ((diff != 0) && (param_2 != 0)) {
sub_080044AE(&gPlayerEntity, diff << 8, 0x18);
}
break;
}
}

Expand Down
Loading