diff --git a/core/io/ip.cpp b/core/io/ip.cpp index d93e3953a62..82187fb025b 100644 --- a/core/io/ip.cpp +++ b/core/io/ip.cpp @@ -259,7 +259,7 @@ PackedStringArray IP::_get_local_addresses() const { List ip_addresses; get_local_addresses(&ip_addresses); for (const IPAddress &E : ip_addresses) { - addresses.push_back(E); + addresses.push_back(String(E)); } return addresses; diff --git a/core/io/ip_address.h b/core/io/ip_address.h index f7e86962676..210f3c053e3 100644 --- a/core/io/ip_address.h +++ b/core/io/ip_address.h @@ -89,7 +89,7 @@ public: const uint8_t *get_ipv6() const; void set_ipv6(const uint8_t *p_buf); - operator String() const; + explicit operator String() const; IPAddress(const String &p_string); IPAddress(uint32_t p_a, uint32_t p_b, uint32_t p_c, uint32_t p_d, bool is_v6 = false); IPAddress() { clear(); } diff --git a/core/io/packet_peer_udp.cpp b/core/io/packet_peer_udp.cpp index 3dbcf49ed44..c662d72f8d0 100644 --- a/core/io/packet_peer_udp.cpp +++ b/core/io/packet_peer_udp.cpp @@ -68,7 +68,7 @@ Error PacketPeerUDP::leave_multicast_group(IPAddress p_multi_address, const Stri } String PacketPeerUDP::_get_packet_ip() const { - return get_packet_address(); + return String(get_packet_address()); } Error PacketPeerUDP::_set_dest_address(const String &p_address, int p_port) { diff --git a/core/variant/variant_internal.h b/core/variant/variant_internal.h index 48d13a5199f..59eff614559 100644 --- a/core/variant/variant_internal.h +++ b/core/variant/variant_internal.h @@ -821,7 +821,7 @@ struct VariantInternalAccessor { template <> struct VariantInternalAccessor { static _FORCE_INLINE_ IPAddress get(const Variant *v) { return IPAddress(*VariantInternal::get_string(v)); } - static _FORCE_INLINE_ void set(Variant *v, IPAddress p_value) { *VariantInternal::get_string(v) = p_value; } + static _FORCE_INLINE_ void set(Variant *v, IPAddress p_value) { *VariantInternal::get_string(v) = String(p_value); } }; template <> diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index fb009eb497f..e6e816e8fb0 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -1386,12 +1386,12 @@ void EditorSettings::setup_network() { } // Select current IP (found) if (ip == current) { - selected = ip; + selected = String(ip); } if (!hint.is_empty()) { hint += ","; } - hint += ip; + hint += String(ip); } // Add hints with valid IP addresses to remote_host property.