Skip to content

Commit

Permalink
Fixed a bug in the process of setting the degree.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nlkomaru committed Feb 5, 2022
1 parent 27557f6 commit 8bc15a8
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ class PlaceDegreeCommand {
TextColor.color(NamedTextColor.RED)
)
)
var nowX = sender.location.blockX - centralXPoint
val nowY = sender.location.blockZ - centralYPoint
if (reverse) {
nowX = -nowX
}
val currentDegree = getRaceDegree(nowX.toDouble(), nowY.toDouble())
val nowX = sender.location.blockX
val nowY = sender.location.blockZ
val relativeNowX = if (!reverse) nowX - centralXPoint else -1 * (nowX - centralXPoint)
val relativeNowY = nowY - centralYPoint
val currentDegree = getRaceDegree(relativeNowY.toDouble(), relativeNowX.toDouble())

sender.sendMessage("Degree: $currentDegree")
var degree = 0
when (currentDegree) {
in 0..45 -> {
Expand Down

0 comments on commit 8bc15a8

Please sign in to comment.