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,51 +267,51 @@ 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;
switch (this->direction >> 3) {
case 0: case 0:
oldValue = that->y.HALF_U.HI; oldValue1 = this->y.HALF_U.HI;
LinearMoveUpdate(that); LinearMoveUpdate(this);
newValue = that->y.HALF_U.HI; newValue1 = this->y.HALF_U.HI;
diff = ((oldValue - newValue) << 0x10) >> 0x10; diff = ((oldValue1 - newValue1));
if ((diff != 0) && (p2 != 0)) { if ((diff != 0) && (param_2 != 0)) {
sub_080044AE(&gPlayerEntity, diff << 8, 0); sub_080044AE(&gPlayerEntity, diff << 8, 0);
} }
break; break;
case 1: case 1:
oldValue = that->x.HALF_U.HI; oldValue2 = this->x.HALF_U.HI;
LinearMoveUpdate(that); LinearMoveUpdate(this);
diff = ((that->x.HALF_U.HI - oldValue) * 0x10000) >> 0x10; newValue2 = this->x.HALF_U.HI;
if ((diff != 0) && (p2 != 0)) { diff = (newValue2 - oldValue2);
if ((diff != 0) && (param_2 != 0)) {
sub_080044AE(&gPlayerEntity, diff << 8, 8); sub_080044AE(&gPlayerEntity, diff << 8, 8);
} }
break; break;
case 2: case 2:
oldValue = that->y.HALF_U.HI; oldValue2 = this->y.HALF_U.HI;
LinearMoveUpdate(that); LinearMoveUpdate(this);
diff = ((that->y.HALF_U.HI - oldValue) * 0x10000) >> 0x10; newValue3 = this->y.HALF_U.HI;
if ((diff != 0) && (p2 != 0)) { diff = (newValue3 - oldValue2);
if ((diff != 0) && (param_2 != 0)) {
sub_080044AE(&gPlayerEntity, diff << 8, 0x10); sub_080044AE(&gPlayerEntity, diff << 8, 0x10);
} }
break; break;
case 3: case 3:
oldValue = that->x.HALF_U.HI; oldValue1 = this->x.HALF_U.HI;
LinearMoveUpdate(that); LinearMoveUpdate(this);
newValue = that->x.HALF_U.HI; newValue4 = this->x.HALF_U.HI;
diff = ((oldValue - newValue) << 0x10) >> 0x10; diff = ((oldValue1 - newValue4));
if ((diff != 0) && (p2 != 0)) { if ((diff != 0) && (param_2 != 0)) {
sub_080044AE(&gPlayerEntity, diff << 8, 0x18); sub_080044AE(&gPlayerEntity, diff << 8, 0x18);
} }
break; break;
} }
}
} }
void UpdateRailMovement(Entity* this, u16** param_2, u16* param_3) { void UpdateRailMovement(Entity* this, u16** param_2, u16* param_3) {