fix: singleton behaviour in ClientNode and ServerNode

This commit is contained in:
Sara Gerretsen 2025-10-16 22:46:47 +02:00
parent 2710ae78c2
commit 8aa6bd7740
2 changed files with 5 additions and 2 deletions

View file

@ -13,6 +13,8 @@ void ClientNode::enter_tree() {
if (singleton_instance) {
print_error("Attempt to create duplicate ClientNode, aborting");
abort();
} else {
singleton_instance = this;
}
}

View file

@ -17,9 +17,10 @@ void ServerNode::enter_tree() {
if (singleton_instance) {
print_error("Attempt to create duplicate ServerNode, aborting");
abort();
} else {
singleton_instance = this;
ydi::server::open();
}
singleton_instance = this;
ydi::server::open();
}
void ServerNode::process(double delta) {