fix: singleton behaviour in ClientNode and ServerNode
This commit is contained in:
parent
2710ae78c2
commit
8aa6bd7740
2 changed files with 5 additions and 2 deletions
|
|
@ -13,6 +13,8 @@ void ClientNode::enter_tree() {
|
|||
if (singleton_instance) {
|
||||
print_error("Attempt to create duplicate ClientNode, aborting");
|
||||
abort();
|
||||
} else {
|
||||
singleton_instance = this;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue