Remove SyncPlayerToPlatform fake match (#667)

* Remove SyncPlayerToPlatform fake match

* Remove shift operators
This commit is contained in:
KEKW555 2023-12-26 10:36:18 +05:30 committed by GitHub
parent bcf5a11c52
commit b03db98200
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 43 additions and 43 deletions

View File

@ -267,50 +267,50 @@ void CreateSparkle(Entity* entity) {
} }
void SyncPlayerToPlatform(Entity* this, bool32 param_2) { void SyncPlayerToPlatform(Entity* this, bool32 param_2) {
s16 oldValue; s16 oldValue1, oldValue2;
s32 diff; s32 newValue1, newValue2, newValue3, newValue4;
u16 newValue; s16 diff;
FORCE_REGISTER(Entity * that, r4) = this;
FORCE_REGISTER(bool32 p2, r6) = param_2;
u16 dir = that->direction;
if ((dir & 0x80) == 0) { if ((this->direction & 0x80) != 0)
switch (dir >> 3) { return;
case 0:
oldValue = that->y.HALF_U.HI; switch (this->direction >> 3) {
LinearMoveUpdate(that); case 0:
newValue = that->y.HALF_U.HI; oldValue1 = this->y.HALF_U.HI;
diff = ((oldValue - newValue) << 0x10) >> 0x10; LinearMoveUpdate(this);
if ((diff != 0) && (p2 != 0)) { newValue1 = this->y.HALF_U.HI;
sub_080044AE(&gPlayerEntity, diff << 8, 0); diff = ((oldValue1 - newValue1));
} if ((diff != 0) && (param_2 != 0)) {
break; sub_080044AE(&gPlayerEntity, diff << 8, 0);
case 1: }
oldValue = that->x.HALF_U.HI; break;
LinearMoveUpdate(that); case 1:
diff = ((that->x.HALF_U.HI - oldValue) * 0x10000) >> 0x10; oldValue2 = this->x.HALF_U.HI;
if ((diff != 0) && (p2 != 0)) { LinearMoveUpdate(this);
sub_080044AE(&gPlayerEntity, diff << 8, 8); newValue2 = this->x.HALF_U.HI;
} diff = (newValue2 - oldValue2);
break; if ((diff != 0) && (param_2 != 0)) {
case 2: sub_080044AE(&gPlayerEntity, diff << 8, 8);
oldValue = that->y.HALF_U.HI; }
LinearMoveUpdate(that); break;
diff = ((that->y.HALF_U.HI - oldValue) * 0x10000) >> 0x10; case 2:
if ((diff != 0) && (p2 != 0)) { oldValue2 = this->y.HALF_U.HI;
sub_080044AE(&gPlayerEntity, diff << 8, 0x10); LinearMoveUpdate(this);
} newValue3 = this->y.HALF_U.HI;
break; diff = (newValue3 - oldValue2);
case 3: if ((diff != 0) && (param_2 != 0)) {
oldValue = that->x.HALF_U.HI; sub_080044AE(&gPlayerEntity, diff << 8, 0x10);
LinearMoveUpdate(that); }
newValue = that->x.HALF_U.HI; break;
diff = ((oldValue - newValue) << 0x10) >> 0x10; case 3:
if ((diff != 0) && (p2 != 0)) { oldValue1 = this->x.HALF_U.HI;
sub_080044AE(&gPlayerEntity, diff << 8, 0x18); LinearMoveUpdate(this);
} newValue4 = this->x.HALF_U.HI;
break; diff = ((oldValue1 - newValue4));
} if ((diff != 0) && (param_2 != 0)) {
sub_080044AE(&gPlayerEntity, diff << 8, 0x18);
}
break;
} }
} }