You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Move Godot Physics 2D into a module; add dummy 2D physics server
If the module is enabled (default), 2D physics works as it did before. If the module is disabled and no other 2D physics server is registered (via a module or GDExtension), then we fall back to a dummy implementation which effectively disables 2D physics functionality (and a warning is printed). The dummy 2D physics server can also be selected explicitly, in which case no warning is printed.
This commit is contained in:
@@ -972,7 +972,9 @@ String PhysicsServer2DManager::get_server_name(int p_id) {
|
||||
}
|
||||
|
||||
PhysicsServer2D *PhysicsServer2DManager::new_default_server() {
|
||||
ERR_FAIL_COND_V(default_server_id == -1, nullptr);
|
||||
if (default_server_id == -1) {
|
||||
return nullptr;
|
||||
}
|
||||
Variant ret;
|
||||
Callable::CallError ce;
|
||||
physics_2d_servers[default_server_id].create_callback.callp(nullptr, 0, ret, ce);
|
||||
|
||||
Reference in New Issue
Block a user