Added a game_crash entity that allows mappers to crash the game and display a message#523
Draft
Wikot235 wants to merge 2 commits intomapbase-source:developfrom
Draft
Added a game_crash entity that allows mappers to crash the game and display a message#523Wikot235 wants to merge 2 commits intomapbase-source:developfrom
Wikot235 wants to merge 2 commits intomapbase-source:developfrom
Conversation
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.
This PR adds a new game_crash entity to Mapbase, it allows mappers to crash the game and display a message.
Inputs
Keyvalues
Now, you might be wondering, what is the difference between type 1 and type 2. There is one big problem with the Error() function used in type 1, you can't change the title of the window, as the function declaration is in tier0 (which we don't have access to).
Because of that, I created the type 2, it's using the MessageBoxA function from windows.h, but it's not perfect either, the first thing, is that I can't perfectly replicate the behavior of the Error() function. The Error() function makes the message box appear AFTER the game window is closed, but with MessageBoxA it shows the message box and only after clicking OK it closes the game window. Apart from that, it generates lots of "macro redefinition" warnings. It only works on Windows, on other OS it will fall back to Error(), but I have no idea how Error() behaves on Linux to be honest, so that might be unnecessary.
PR Checklist
developbranch OR targets another branch with a specific goal in mind