Fixed commands not registering properly when given strings are not persistent #240
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.
Fixed names starting with / and ! (and probably others, as well) not being registered properly.
I'm not entirely sure this is the best way to fix, which is why I created a pull request instead of just merging into master. It does work properly, though, for my testing with GunGame.
Before this fix, none of my say commands that started with ! or / were working. I added some debug messages in
src/core/modules/commands/commands.hwhere the comparisons are made, and all of the say commands that started with / or ! showed as a bunch of weird symbols. That led me to believe that I needed to make copies before registering.I believe I could also do this by storing all of these as attributes in GunGame itself, so they persist. However, I don't necessarily believe that is the correct action to take in this instance as others might easily end up in my situation in the future without a permanent fix in SP itself.