Fix player relative yaw when exiting portal (Fixes #4)

This commit is contained in:
Michael Smith 2020-08-28 02:51:25 -07:00
parent 4c5ffed531
commit 654ddefb6e
No known key found for this signature in database
GPG Key ID: 41F47A53EDE95BE1

View File

@ -477,11 +477,9 @@ public class Portal {
// Handle backwards gates
int adjust = 180;
if (isBackwards() || origin.isBackwards())
if (isBackwards() != origin.isBackwards())
adjust = 0;
if (isBackwards() && origin.isBackwards())
adjust = 180;
exit.setYaw(origin.getRotation() - traveller.getYaw() + this.getRotation() + adjust);
exit.setYaw(traveller.getYaw() - origin.getRotation() + this.getRotation() + adjust);
// Call the StargatePortalEvent to allow plugins to change destination
if (!origin.equals(this)) {