Skip to content

Conversation

@FlorianLeChat
Copy link
Contributor

@FlorianLeChat FlorianLeChat commented May 9, 2021

Following these modifications, here are the changes:

  • The library code has been cleaned up to be more readable and cleaner.
  • Improvements and small optimisations have been made along with the cleanup.
  • The /looc command delay has been fixed as it was not working, sometimes creating Lua errors or just had no real restrictions.
  • The introduction of a new property to allow dynamic retrieval of a value instead of having a static number (useful for some server parameters like chatRadius).
  • Change the current commands to add the new parameter.

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.

- 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.
@FlorianLeChat FlorianLeChat marked this pull request as draft May 9, 2021 17:12
@FlorianLeChat FlorianLeChat changed the title Fix the non-updating of some parameters on commands. Fix the non-updating of some parameters on commands May 9, 2021
@FlorianLeChat FlorianLeChat marked this pull request as ready for review May 11, 2021 19:21
As requested by Tovarisch and for consistency with the rest of the code.
@FlorianLeChat
Copy link
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.

@TovarischPootis TovarischPootis merged commit 5df87da into NutScript:1.2.2-wip May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants