-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a safeguard to map command #529
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to get this merged, just a couple of questions/suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Game does not crash anymore when passed an invalid map name, and prints a nice warning message instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like how you replace the con command callback and then call the original. The original is just a few lines of code so I'd prefer we hook it and reconstruct it.
I can do this if you don't have the time to do so.
I can't find the function for it in ghidra 😞 |
ghidra decided to combine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still works as expected, game does not crash when command is given an incorrect map name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes that I requested were addressed/are now outdated. Code looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks good
extra check if the map actually exists may be overkill, but the vanilla map command is fragile so its probably best to guard it from inputs it may not be capable of handling
Game crashes if you try and do a map command with an invalid map |
yeah my tired brain thought about the wrong thing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the following inputs for the PR
map <-- shows appropriate warning as expected
map mp_glich <-- shows appropriate warning as expected
map mp_glitch <-- loads map as expected
without this PR what happens
map <-- nothing happens
map mp_glich <-- crashes game with error message about missing map
map mp_glitch <-- loads map as expected
Didn't do any code review as others have already covered that part anyway and I don't feel qualified enough apart from spotting basic errors.
requested changes were implemented
@F1F7Y I dismissed your review that requests changes as the requested changes have since been implemented as far as I can tell and the lack of a re-review was blocking the PR ^^ |
Has this been tested on maps which are in an installed mod but that mod is disabled? Looking at the code changes it seems not… |
This reverts commit cde626b.
This breaks docker image as per pg9182/northstar-dedicated#70 |
Adds safeguard to the `map` command that prevents it from executing if the requested map is invalid or no map argument is given.
Adds safeguard to the `map` command that prevents it from executing if the requested map is invalid or no map argument is given. Retry of #529 Co-authored-by: cat_or_not <[email protected]>
Adds safeguard to the `map` command that prevents it from executing if the requested map is invalid or no map argument is given. Retry of #529 Co-authored-by: cat_or_not <[email protected]> (cherry picked from commit da7061a)
adds safeguard to the map command that prevents it from executing if the map is invalid.
I wanted to implement this originally as a plugin but I think it might be quite useful for everyone.