-
-
Notifications
You must be signed in to change notification settings - Fork 433
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
[Bug]: Inconsistent behavior of new GameData / LoadGameConfigFile #2250
Comments
sourcemod/core/logic/GameConfigs.cpp Lines 1173 to 1186 in 8fc2f39
We should reparse too when |
Voicing my opinion on the matter, I think we should embrace that unintended behavior. Throwing on missing gamedata file is a bad idea, and plugins out there already rely on the idea that null return == gamedata not loaded. As per the documention So on top of fixing the loading function, I'd recommend just removing the exception : if (!g_GameConfigs.LoadGameConfigFile(filename, &gc, error, sizeof(error)))
{
- return pCtx->ThrowNativeError("Unable to open %s: %s", filename, error);
+ return BAD_HANDLE;
} |
This makes sense to me. Give them a better and consistent chance to handle the the issue, while still throwing later anyway if it's null / INVALID_HANDLE without them handling that case. |
Prerequisites
Operating System and Version
Windows 10 22H2
Game / AppID and Version
Team Fortress 2 (440) build 9433646
SourceMod Version
1.13.0.7194
Metamod:Source Version
1.12.0-dev+1211
Version Verification
Updated SourceMod Version
No response
Updated Metamod:Source Version
No response
Description
The first time a plugin calls
new GameData
/LoadGameConfigFile
it throws an error if the file doesn't exists.If the plugin is reloaded, then it returns a valid handle (to a gamedata file that doesn't exists).
Steps to Reproduce
Plugin code:
sm plugins reload
.Relevant Log Output
The text was updated successfully, but these errors were encountered: