summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/io/multiplayer_api.cpp4
-rw-r--r--core/templates/pair.h5
2 files changed, 5 insertions, 4 deletions
diff --git a/core/io/multiplayer_api.cpp b/core/io/multiplayer_api.cpp
index 564397c88c..9f92388196 100644
--- a/core/io/multiplayer_api.cpp
+++ b/core/io/multiplayer_api.cpp
@@ -1068,9 +1068,7 @@ int MultiplayerAPI::get_network_unique_id() const {
}
bool MultiplayerAPI::is_network_server() const {
- // XXX Maybe fail silently? Maybe should actually return true to make development of both local and online multiplayer easier?
- ERR_FAIL_COND_V_MSG(!network_peer.is_valid(), false, "No network peer is assigned. I can't be a server.");
- return network_peer->is_server();
+ return network_peer.is_valid() && network_peer->is_server();
}
void MultiplayerAPI::set_refuse_new_network_connections(bool p_refuse) {
diff --git a/core/templates/pair.h b/core/templates/pair.h
index 31706b6ecb..e30ee8bc56 100644
--- a/core/templates/pair.h
+++ b/core/templates/pair.h
@@ -62,7 +62,10 @@ bool operator!=(const Pair<F, S> &pair, const Pair<F, S> &other) {
template <class F, class S>
struct PairSort {
bool operator()(const Pair<F, S> &A, const Pair<F, S> &B) const {
- return A.first < B.first;
+ if (A.first != B.first) {
+ return A.first < B.first;
+ }
+ return A.second < B.second;
}
};