Fix the non-updating of some parameters on commands#68
Merged
TovarischPootis merged 6 commits intoNutScript:1.2.2-wipfrom May 25, 2021
FlorianLeChat:dynamic-chat-radius
Merged
Fix the non-updating of some parameters on commands#68TovarischPootis merged 6 commits intoNutScript:1.2.2-wipfrom FlorianLeChat:dynamic-chat-radius
TovarischPootis merged 6 commits intoNutScript:1.2.2-wipfrom
FlorianLeChat:dynamic-chat-radius
Conversation
- Spaces before/after operators - Remove trailling whitespace
- Lua operators - Useless key argument in some loops - Merge double if statements
Error messages and checks will now use the correct parameters.
As things stand, it's not possible for a range to be bound to a dynamic variable (as for example with the "chatRange" parameter which is only retrieved during registration). In order not to break compatibility with commands created on other addons/servers, I introduce a new property as a function and under the name "radius". This function will return the value of a parameter each time it's called, thus correcting this little fixed range issue.
As stated in the last commit, this will automatically adjust the range of these commands through the "chatRange" parameter.
As requested by Tovarisch and for consistency with the rest of the code.
Contributor
Author
|
Static numbers are now allowed for the new property even if it duplicates the onCanHear property, this allows some consistency in the code and avoids confusion. |
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.
Following these modifications, here are the changes:
chatRadius).Due to the number of changes, this is still being tested but so far no one has reported any issues.Also, the compatibility of existing commands or commands from other servers is not broken.