[Commands] Add #zonevariable Command#4882
Merged
Conversation
Akkadius
reviewed
May 15, 2025
zone/gm_commands/zonevariable.cpp
Outdated
|
|
||
| c->Message(Chat::White, "Cleared all zone variables."); | ||
| } else if (is_delete) { | ||
| const std::string variable_name = sep->argplus[2]; |
Contributor
There was a problem hiding this comment.
This could crash if input is bad
const std::string variable_name = (sep->argplus.size() > 2) ? sep->argplus[2] : "";
Akkadius
reviewed
May 15, 2025
zone/gm_commands/zonevariable.cpp
Outdated
|
|
||
| return; | ||
| } else if (is_set) { | ||
| const std::string variable_name = sep->arg[2]; |
Contributor
There was a problem hiding this comment.
Need input validation here as well
Akkadius
reviewed
May 15, 2025
zone/gm_commands/zonevariable.cpp
Outdated
| uint32 variable_count = 0; | ||
| uint32 variable_number = 1; | ||
|
|
||
| const std::string search_criteria = arguments >= 2 ? sep->argplus[2] : ""; |
Contributor
There was a problem hiding this comment.
You checked for inputs here so we're good
Akkadius
approved these changes
May 15, 2025
Contributor
Akkadius
left a comment
There was a problem hiding this comment.
Looks good, few comments though that could crash
Contributor
|
Added argument safety for you |
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
#zonevariablecommand that allows manipulation of zone variables.Type of change
Testing
Checklist