Fix bug that allowed banner capture at unlimited distance below the banner#970
Merged
LlmDl merged 1 commit intoTownyAdvanced:masterfrom May 26, 2025
p3sto:master
Merged
Fix bug that allowed banner capture at unlimited distance below the banner#970LlmDl merged 1 commit intoTownyAdvanced:masterfrom p3sto:master
LlmDl merged 1 commit intoTownyAdvanced:masterfrom
p3sto:master
Conversation
LlmDl
approved these changes
May 26, 2025
Contributor
|
Wow 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
There has been an existing bug in SiegeWar that has gone unnoticed for quite a long time (about a year). The bug allows players to capture the banner at any height below the banner, completely ignoring the
war.distances.banner_control_session_radius_blocksconfig setting. This PR aims to solve this bug by simplifying the vertical distance check and fixing the issue.The Bug
The issue is with how the vertical distance check between the player and flag is calculated. Currently, the calculation for the vertical distance is calculated as follows:
If the player is below the flag, then this difference in their Y is negative producing a square root that is always NaN. When compared to any
maxAllowedDistance(always false), the return is true allowing the check to incorrectly pass.New Nodes/Commands/ConfigOptions:
Relevant Issue ticket:
By making this pull request, I represent that I have the right to waive copyright and related rights to my contribution, and agree that all copyright and related rights in my contributions are waived, and I acknowledge that the TownyAdvanced organization has the copyright to use and modify my contribution under the SiegeWar License for perpetuity.