You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following warning is printed whenever you run Godot in a debug build with --verbose:
WARNING: Server features cannot be checked before RenderingServer has been created. If you are checking a server feature, consider moving your OS::has_feature call after INITIALIZATION_LEVEL_SERVERS.
at: has_feature (core/os/os.cpp:544)
if (has_server_feature_callback && has_server_feature_callback(p_feature)) {
return true;
}
after
if (has_server_feature_callback) {
return has_server_feature_callback(p_feature);
}
#ifdef DEBUG_ENABLED
else if (is_stdout_verbose()) {
WARN_PRINT_ONCE("Server features cannot be checked before RenderingServer has been created. If you are checking a server feature, consider moving your OS::has_feature call after INITIALIZATION_LEVEL_SERVERS.");
}
#endif
Before if either has_server_feature_callback or has_server_feature_callback(p_feature) was false, the function would continue and check if (ProjectSettings::get_singleton()->has_custom_feature(p_feature)). With the new logic the warning is printed any time that has_server_feature_callback is false and the code returns early whenever has_server_feature_callback is true. I suspect that neither of those things are intended
Sorry for the issue. I’ll write up a PR later today that fixes the early return and moves the warning until after all other checks.
If the check still fails to find the feature, it’ll print the warning, regardless of if the call was originally intended to check a server feature or not. That could be annoy for people who really want 0 warnings in their console. So, another “fix” for this issue could be to remove the warning entirely. I don’t have a preference either way.
Tested versions
Current master 56a7dba
System information
Godot v4.4.dev (5ea9e8b26) - Pop!_OS 22.04 LTS on X11 - X11 display driver, Multi-window, 1 monitor - OpenGL 3 (Compatibility) - Mesa Intel(R) Xe Graphics (TGL GT2) - 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (8 threads)
Issue description
The following warning is printed whenever you run Godot in a debug build with
--verbose
:Introduced by #98862
Here is the relevant code:
before
after
Before if either
has_server_feature_callback
orhas_server_feature_callback(p_feature)
was false, the function would continue and checkif (ProjectSettings::get_singleton()->has_custom_feature(p_feature))
. With the new logic the warning is printed any time thathas_server_feature_callback
isfalse
and the code returns early wheneverhas_server_feature_callback
is true. I suspect that neither of those things are intendedCC @HuntJSparra
Steps to reproduce
Run Godot from the command line with --verbose and observe
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered: