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

Attempted to add a way to set the rotation of the banner to at 16 sub… #231

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

rstlnmage
Copy link
Collaborator

…divisions of the cardinal directions.

CaptureTheFlagMatch#getClosestDirection sets new flag face to closest of the 16 divisions using CaptureTheFlagMatch#getYawFromBlockFace
Fixed comment @line 540

…divisions of the cardinal directions.

CaptureTheFlagMatch#getClosestDirection sets new flag face to closest of the 16 divisions using CaptureTheFlagMatch#getYawFromBlockFace
Fixed comment @line 540
@rstlnmage rstlnmage linked an issue Jun 24, 2023 that may be closed by this pull request
1 task
@Braekpo1nt
Copy link
Owner

I reviewed the code, and while it may work, and it's a clever way of doing it, I think there's a more efficient check.

Instead of cycling through the potential directions and checking which yaw is the closest to it, you could do a single check through a list of if-else statements, each of which checks if the yaw is in a particular range and, if so, return the appropriate BlockDirection. Ask me if you need clarification :)

@rstlnmage
Copy link
Collaborator Author

I reviewed the code, and while it may work, and it's a clever way of doing it, I think there's a more efficient check.

Instead of cycling through the potential directions and checking which yaw is the closest to it, you could do a single check through a list of if-else statements, each of which checks if the yaw is in a particular range and, if so, return the appropriate BlockDirection. Ask me if you need clarification :)

I'll give it a try first, then hit you up for what you had i mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

Flag gets dropped facing direction of killed player
2 participants