Skip to content

[GEN][ZH] Demote throw to assert in InGameUI::message, InGameUI::messageColor #860

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

Merged

Conversation

xezon
Copy link

@xezon xezon commented May 14, 2025

This change demotes unnecessary throw to debug assert in functions InGameUI::message and InGameUI::messageColor. Unnecessary throw because this format error is not necessarily a fatal error that needs to terminate the process. The program may just run fine with this error. The debug assert is enough to see the error.

@xezon xezon added this to the Stability fixes milestone May 14, 2025
@xezon xezon added Minor Severity: Minor < Major < Critical < Blocker Refactor Improves the structure of the code, with negligible changes in function. Stability Concerns stability of the runtime labels May 14, 2025
Copy link

@Mauller Mauller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, that throw on out of memory for the gui string is nasty.

@xezon xezon added Gen Relates to Generals ZH Relates to Zero Hour labels May 16, 2025
@xezon xezon merged commit 455dfab into TheSuperHackers:main May 16, 2025
18 checks passed
@xezon xezon deleted the xezon/remove-throw-ingameui-message branch May 16, 2025 17:37

// add the text to the ui
addMessageText( formattedMessage, rgbColor );
int result = _vsnwprintf(buf, sizeof( buf )/sizeof( WideChar ) - 1, format.str(), args );
Copy link
Author

@xezon xezon May 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A mistake creeped in here. va_end(args) was lost by mistake. I will fix in follow up. #872

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker Refactor Improves the structure of the code, with negligible changes in function. Stability Concerns stability of the runtime ZH Relates to Zero Hour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants