Просмотр исходного кода

[Modules] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable

A Thousand Ships 1 год назад
Родитель
Сommit
517e9f8aef
44 измененных файлов с 474 добавлено и 474 удалено
  1. 2 2
      drivers/vulkan/vulkan_context.cpp
  2. 1 1
      modules/basis_universal/register_types.cpp
  3. 2 2
      modules/csg/csg_shape.cpp
  4. 22 22
      modules/enet/enet_connection.cpp
  5. 18 18
      modules/enet/enet_packet_peer.cpp
  6. 2 2
      modules/gdscript/gdscript.cpp
  7. 1 1
      modules/gdscript/gdscript_analyzer.cpp
  8. 1 1
      modules/gdscript/gdscript_cache.cpp
  9. 1 1
      modules/gdscript/gdscript_compiler.cpp
  10. 1 1
      modules/gdscript/gdscript_function.cpp
  11. 1 1
      modules/gdscript/gdscript_function.h
  12. 1 1
      modules/gdscript/gdscript_parser.cpp
  13. 1 1
      modules/gdscript/gdscript_parser.h
  14. 1 1
      modules/gdscript/gdscript_rpc_callable.cpp
  15. 9 9
      modules/gdscript/gdscript_utility_functions.cpp
  16. 2 2
      modules/gdscript/language_server/gdscript_language_protocol.cpp
  17. 1 1
      modules/gltf/extensions/gltf_light.cpp
  18. 1 1
      modules/gltf/extensions/physics/gltf_physics_body.cpp
  19. 6 6
      modules/gltf/gltf_document.cpp
  20. 1 1
      modules/gltf/structures/gltf_camera.cpp
  21. 3 3
      modules/mbedtls/crypto_mbedtls.cpp
  22. 2 2
      modules/mbedtls/packet_peer_mbed_dtls.cpp
  23. 2 2
      modules/mbedtls/stream_peer_mbedtls.cpp
  24. 1 1
      modules/mono/class_db_api_json.cpp
  25. 1 1
      modules/mono/mono_gd/gd_mono_cache.cpp
  26. 2 2
      modules/multiplayer/editor/replication_editor.cpp
  27. 2 2
      modules/multiplayer/multiplayer_debugger.cpp
  28. 3 3
      modules/multiplayer/multiplayer_spawner.cpp
  29. 5 5
      modules/multiplayer/multiplayer_synchronizer.cpp
  30. 7 7
      modules/multiplayer/scene_cache_interface.cpp
  31. 14 14
      modules/multiplayer/scene_replication_interface.cpp
  32. 3 3
      modules/multiplayer/scene_rpc_interface.cpp
  33. 1 1
      modules/navigation/editor/navigation_mesh_editor_plugin.cpp
  34. 102 102
      modules/navigation/godot_navigation_server.cpp
  35. 6 6
      modules/navigation/nav_mesh_generator_3d.cpp
  36. 2 2
      modules/navigation/nav_region.cpp
  37. 5 5
      modules/raycast/raycast_occlusion_cull.cpp
  38. 112 112
      modules/text_server_adv/text_server_adv.cpp
  39. 112 112
      modules/text_server_fb/text_server_fb.cpp
  40. 2 2
      modules/upnp/upnp.cpp
  41. 2 2
      modules/websocket/wsl_peer.cpp
  42. 7 7
      platform/macos/display_server_macos.mm
  43. 2 2
      platform/windows/display_server_windows.cpp
  44. 1 1
      thirdparty/enet/godot.cpp

+ 2 - 2
drivers/vulkan/vulkan_context.cpp

@@ -1887,7 +1887,7 @@ Error VulkanContext::_update_swap_chain(Window *window) {
 	err = fpGetPhysicalDeviceSurfacePresentModesKHR(gpu, window->surface, &presentModeCount, nullptr);
 	err = fpGetPhysicalDeviceSurfacePresentModesKHR(gpu, window->surface, &presentModeCount, nullptr);
 	ERR_FAIL_COND_V(err, ERR_CANT_CREATE);
 	ERR_FAIL_COND_V(err, ERR_CANT_CREATE);
 	VkPresentModeKHR *presentModes = (VkPresentModeKHR *)malloc(presentModeCount * sizeof(VkPresentModeKHR));
 	VkPresentModeKHR *presentModes = (VkPresentModeKHR *)malloc(presentModeCount * sizeof(VkPresentModeKHR));
-	ERR_FAIL_COND_V(!presentModes, ERR_CANT_CREATE);
+	ERR_FAIL_NULL_V(presentModes, ERR_CANT_CREATE);
 	err = fpGetPhysicalDeviceSurfacePresentModesKHR(gpu, window->surface, &presentModeCount, presentModes);
 	err = fpGetPhysicalDeviceSurfacePresentModesKHR(gpu, window->surface, &presentModeCount, presentModes);
 	if (err) {
 	if (err) {
 		free(presentModes);
 		free(presentModes);
@@ -2062,7 +2062,7 @@ Error VulkanContext::_update_swap_chain(Window *window) {
 	}
 	}
 
 
 	VkImage *swapchainImages = (VkImage *)malloc(swapchainImageCount * sizeof(VkImage));
 	VkImage *swapchainImages = (VkImage *)malloc(swapchainImageCount * sizeof(VkImage));
-	ERR_FAIL_COND_V(!swapchainImages, ERR_CANT_CREATE);
+	ERR_FAIL_NULL_V(swapchainImages, ERR_CANT_CREATE);
 	err = fpGetSwapchainImagesKHR(device, window->swapchain, &swapchainImageCount, swapchainImages);
 	err = fpGetSwapchainImagesKHR(device, window->swapchain, &swapchainImageCount, swapchainImages);
 	if (err) {
 	if (err) {
 		free(swapchainImages);
 		free(swapchainImages);

+ 1 - 1
modules/basis_universal/register_types.cpp

@@ -162,7 +162,7 @@ static Ref<Image> basis_universal_unpacker_ptr(const uint8_t *p_data, int p_size
 
 
 	const uint8_t *ptr = p_data;
 	const uint8_t *ptr = p_data;
 	int size = p_size;
 	int size = p_size;
-	ERR_FAIL_COND_V_MSG(p_data == nullptr, image, "Cannot unpack invalid basis universal data.");
+	ERR_FAIL_NULL_V_MSG(p_data, image, "Cannot unpack invalid basis universal data.");
 
 
 	basist::transcoder_texture_format format = basist::transcoder_texture_format::cTFTotalTextureFormats;
 	basist::transcoder_texture_format format = basist::transcoder_texture_format::cTFTotalTextureFormats;
 	Image::Format imgfmt = Image::FORMAT_MAX;
 	Image::Format imgfmt = Image::FORMAT_MAX;

+ 2 - 2
modules/csg/csg_shape.cpp

@@ -300,7 +300,7 @@ void CSGShape3D::_update_shape() {
 	root_mesh.unref(); //byebye root mesh
 	root_mesh.unref(); //byebye root mesh
 
 
 	CSGBrush *n = _get_brush();
 	CSGBrush *n = _get_brush();
-	ERR_FAIL_COND_MSG(!n, "Cannot get CSGBrush.");
+	ERR_FAIL_NULL_MSG(n, "Cannot get CSGBrush.");
 
 
 	OAHashMap<Vector3, Vector3> vec_map;
 	OAHashMap<Vector3, Vector3> vec_map;
 
 
@@ -458,7 +458,7 @@ void CSGShape3D::_update_shape() {
 void CSGShape3D::_update_collision_faces() {
 void CSGShape3D::_update_collision_faces() {
 	if (use_collision && is_root_shape() && root_collision_shape.is_valid()) {
 	if (use_collision && is_root_shape() && root_collision_shape.is_valid()) {
 		CSGBrush *n = _get_brush();
 		CSGBrush *n = _get_brush();
-		ERR_FAIL_COND_MSG(!n, "Cannot get CSGBrush.");
+		ERR_FAIL_NULL_MSG(n, "Cannot get CSGBrush.");
 		Vector<Vector3> physics_faces;
 		Vector<Vector3> physics_faces;
 		physics_faces.resize(n->faces.size() * 3);
 		physics_faces.resize(n->faces.size() * 3);
 		Vector3 *physicsw = physics_faces.ptrw();
 		Vector3 *physicsw = physics_faces.ptrw();

+ 22 - 22
modules/enet/enet_connection.cpp

@@ -37,7 +37,7 @@
 #include "core/variant/typed_array.h"
 #include "core/variant/typed_array.h"
 
 
 void ENetConnection::broadcast(enet_uint8 p_channel, ENetPacket *p_packet) {
 void ENetConnection::broadcast(enet_uint8 p_channel, ENetPacket *p_packet) {
-	ERR_FAIL_COND_MSG(!host, "The ENetConnection instance isn't currently active.");
+	ERR_FAIL_NULL_MSG(host, "The ENetConnection instance isn't currently active.");
 	ERR_FAIL_COND_MSG(p_channel >= host->channelLimit, vformat("Unable to send packet on channel %d, max channels: %d", p_channel, (int)host->channelLimit));
 	ERR_FAIL_COND_MSG(p_channel >= host->channelLimit, vformat("Unable to send packet on channel %d, max channels: %d", p_channel, (int)host->channelLimit));
 	enet_host_broadcast(host, p_channel, p_packet);
 	enet_host_broadcast(host, p_channel, p_packet);
 }
 }
@@ -71,7 +71,7 @@ Error ENetConnection::create_host(int p_max_peers, int p_max_channels, int p_in_
 }
 }
 
 
 void ENetConnection::destroy() {
 void ENetConnection::destroy() {
-	ERR_FAIL_COND_MSG(!host, "Host already destroyed");
+	ERR_FAIL_NULL_MSG(host, "Host already destroyed.");
 	for (List<Ref<ENetPacketPeer>>::Element *E = peers.front(); E; E = E->next()) {
 	for (List<Ref<ENetPacketPeer>>::Element *E = peers.front(); E; E = E->next()) {
 		E->get()->_on_disconnect();
 		E->get()->_on_disconnect();
 	}
 	}
@@ -82,7 +82,7 @@ void ENetConnection::destroy() {
 
 
 Ref<ENetPacketPeer> ENetConnection::connect_to_host(const String &p_address, int p_port, int p_channels, int p_data) {
 Ref<ENetPacketPeer> ENetConnection::connect_to_host(const String &p_address, int p_port, int p_channels, int p_data) {
 	Ref<ENetPacketPeer> out;
 	Ref<ENetPacketPeer> out;
-	ERR_FAIL_COND_V_MSG(!host, out, "The ENetConnection instance isn't currently active.");
+	ERR_FAIL_NULL_V_MSG(host, out, "The ENetConnection instance isn't currently active.");
 	ERR_FAIL_COND_V_MSG(peers.size(), out, "The ENetConnection is already connected to a peer.");
 	ERR_FAIL_COND_V_MSG(peers.size(), out, "The ENetConnection is already connected to a peer.");
 	ERR_FAIL_COND_V_MSG(p_port < 1 || p_port > 65535, out, "The remote port number must be between 1 and 65535 (inclusive).");
 	ERR_FAIL_COND_V_MSG(p_port < 1 || p_port > 65535, out, "The remote port number must be between 1 and 65535 (inclusive).");
 
 
@@ -160,7 +160,7 @@ ENetConnection::EventType ENetConnection::_parse_event(const ENetEvent &p_event,
 }
 }
 
 
 ENetConnection::EventType ENetConnection::service(int p_timeout, Event &r_event) {
 ENetConnection::EventType ENetConnection::service(int p_timeout, Event &r_event) {
-	ERR_FAIL_COND_V_MSG(!host, EVENT_ERROR, "The ENetConnection instance isn't currently active.");
+	ERR_FAIL_NULL_V_MSG(host, EVENT_ERROR, "The ENetConnection instance isn't currently active.");
 	ERR_FAIL_COND_V(r_event.peer.is_valid(), EVENT_ERROR);
 	ERR_FAIL_COND_V(r_event.peer.is_valid(), EVENT_ERROR);
 
 
 	// Drop peers that have already been disconnected.
 	// Drop peers that have already been disconnected.
@@ -186,7 +186,7 @@ ENetConnection::EventType ENetConnection::service(int p_timeout, Event &r_event)
 }
 }
 
 
 int ENetConnection::check_events(EventType &r_type, Event &r_event) {
 int ENetConnection::check_events(EventType &r_type, Event &r_event) {
-	ERR_FAIL_COND_V_MSG(!host, -1, "The ENetConnection instance isn't currently active.");
+	ERR_FAIL_NULL_V_MSG(host, -1, "The ENetConnection instance isn't currently active.");
 	ENetEvent event;
 	ENetEvent event;
 	int ret = enet_host_check_events(host, &event);
 	int ret = enet_host_check_events(host, &event);
 	if (ret < 0) {
 	if (ret < 0) {
@@ -198,32 +198,32 @@ int ENetConnection::check_events(EventType &r_type, Event &r_event) {
 }
 }
 
 
 void ENetConnection::flush() {
 void ENetConnection::flush() {
-	ERR_FAIL_COND_MSG(!host, "The ENetConnection instance isn't currently active.");
+	ERR_FAIL_NULL_MSG(host, "The ENetConnection instance isn't currently active.");
 	enet_host_flush(host);
 	enet_host_flush(host);
 }
 }
 
 
 void ENetConnection::bandwidth_limit(int p_in_bandwidth, int p_out_bandwidth) {
 void ENetConnection::bandwidth_limit(int p_in_bandwidth, int p_out_bandwidth) {
-	ERR_FAIL_COND_MSG(!host, "The ENetConnection instance isn't currently active.");
+	ERR_FAIL_NULL_MSG(host, "The ENetConnection instance isn't currently active.");
 	enet_host_bandwidth_limit(host, p_in_bandwidth, p_out_bandwidth);
 	enet_host_bandwidth_limit(host, p_in_bandwidth, p_out_bandwidth);
 }
 }
 
 
 void ENetConnection::channel_limit(int p_max_channels) {
 void ENetConnection::channel_limit(int p_max_channels) {
-	ERR_FAIL_COND_MSG(!host, "The ENetConnection instance isn't currently active.");
+	ERR_FAIL_NULL_MSG(host, "The ENetConnection instance isn't currently active.");
 	enet_host_channel_limit(host, p_max_channels);
 	enet_host_channel_limit(host, p_max_channels);
 }
 }
 
 
 void ENetConnection::bandwidth_throttle() {
 void ENetConnection::bandwidth_throttle() {
-	ERR_FAIL_COND_MSG(!host, "The ENetConnection instance isn't currently active.");
+	ERR_FAIL_NULL_MSG(host, "The ENetConnection instance isn't currently active.");
 	enet_host_bandwidth_throttle(host);
 	enet_host_bandwidth_throttle(host);
 }
 }
 
 
 void ENetConnection::compress(CompressionMode p_mode) {
 void ENetConnection::compress(CompressionMode p_mode) {
-	ERR_FAIL_COND_MSG(!host, "The ENetConnection instance isn't currently active.");
+	ERR_FAIL_NULL_MSG(host, "The ENetConnection instance isn't currently active.");
 	Compressor::setup(host, p_mode);
 	Compressor::setup(host, p_mode);
 }
 }
 
 
 double ENetConnection::pop_statistic(HostStatistic p_stat) {
 double ENetConnection::pop_statistic(HostStatistic p_stat) {
-	ERR_FAIL_COND_V_MSG(!host, 0, "The ENetConnection instance isn't currently active.");
+	ERR_FAIL_NULL_V_MSG(host, 0, "The ENetConnection instance isn't currently active.");
 	uint32_t *ptr = nullptr;
 	uint32_t *ptr = nullptr;
 	switch (p_stat) {
 	switch (p_stat) {
 		case HOST_TOTAL_SENT_DATA:
 		case HOST_TOTAL_SENT_DATA:
@@ -239,19 +239,19 @@ double ENetConnection::pop_statistic(HostStatistic p_stat) {
 			ptr = &(host->totalReceivedPackets);
 			ptr = &(host->totalReceivedPackets);
 			break;
 			break;
 	}
 	}
-	ERR_FAIL_COND_V_MSG(ptr == nullptr, 0, "Invalid statistic: " + itos(p_stat));
+	ERR_FAIL_NULL_V_MSG(ptr, 0, "Invalid statistic: " + itos(p_stat) + ".");
 	uint32_t ret = *ptr;
 	uint32_t ret = *ptr;
 	*ptr = 0;
 	*ptr = 0;
 	return ret;
 	return ret;
 }
 }
 
 
 int ENetConnection::get_max_channels() const {
 int ENetConnection::get_max_channels() const {
-	ERR_FAIL_COND_V_MSG(!host, 0, "The ENetConnection instance isn't currently active.");
+	ERR_FAIL_NULL_V_MSG(host, 0, "The ENetConnection instance isn't currently active.");
 	return host->channelLimit;
 	return host->channelLimit;
 }
 }
 
 
 int ENetConnection::get_local_port() const {
 int ENetConnection::get_local_port() const {
-	ERR_FAIL_COND_V_MSG(!host, 0, "The ENetConnection instance isn't currently active.");
+	ERR_FAIL_NULL_V_MSG(host, 0, "The ENetConnection instance isn't currently active.");
 	ERR_FAIL_COND_V_MSG(!(host->socket), 0, "The ENetConnection instance isn't currently bound");
 	ERR_FAIL_COND_V_MSG(!(host->socket), 0, "The ENetConnection instance isn't currently bound");
 	ENetAddress address;
 	ENetAddress address;
 	ERR_FAIL_COND_V_MSG(enet_socket_get_address(host->socket, &address), 0, "Unable to get socket address");
 	ERR_FAIL_COND_V_MSG(enet_socket_get_address(host->socket, &address), 0, "Unable to get socket address");
@@ -265,7 +265,7 @@ void ENetConnection::get_peers(List<Ref<ENetPacketPeer>> &r_peers) {
 }
 }
 
 
 TypedArray<ENetPacketPeer> ENetConnection::_get_peers() {
 TypedArray<ENetPacketPeer> ENetConnection::_get_peers() {
-	ERR_FAIL_COND_V_MSG(!host, Array(), "The ENetConnection instance isn't currently active.");
+	ERR_FAIL_NULL_V_MSG(host, Array(), "The ENetConnection instance isn't currently active.");
 	TypedArray<ENetPacketPeer> out;
 	TypedArray<ENetPacketPeer> out;
 	for (const Ref<ENetPacketPeer> &I : peers) {
 	for (const Ref<ENetPacketPeer> &I : peers) {
 		out.push_back(I);
 		out.push_back(I);
@@ -275,7 +275,7 @@ TypedArray<ENetPacketPeer> ENetConnection::_get_peers() {
 
 
 Error ENetConnection::dtls_server_setup(const Ref<TLSOptions> &p_options) {
 Error ENetConnection::dtls_server_setup(const Ref<TLSOptions> &p_options) {
 #ifdef GODOT_ENET
 #ifdef GODOT_ENET
-	ERR_FAIL_COND_V_MSG(!host, ERR_UNCONFIGURED, "The ENetConnection instance isn't currently active.");
+	ERR_FAIL_NULL_V_MSG(host, ERR_UNCONFIGURED, "The ENetConnection instance isn't currently active.");
 	ERR_FAIL_COND_V(p_options.is_null() || !p_options->is_server(), ERR_INVALID_PARAMETER);
 	ERR_FAIL_COND_V(p_options.is_null() || !p_options->is_server(), ERR_INVALID_PARAMETER);
 	return enet_host_dtls_server_setup(host, const_cast<TLSOptions *>(p_options.ptr())) ? FAILED : OK;
 	return enet_host_dtls_server_setup(host, const_cast<TLSOptions *>(p_options.ptr())) ? FAILED : OK;
 #else
 #else
@@ -285,7 +285,7 @@ Error ENetConnection::dtls_server_setup(const Ref<TLSOptions> &p_options) {
 
 
 void ENetConnection::refuse_new_connections(bool p_refuse) {
 void ENetConnection::refuse_new_connections(bool p_refuse) {
 #ifdef GODOT_ENET
 #ifdef GODOT_ENET
-	ERR_FAIL_COND_MSG(!host, "The ENetConnection instance isn't currently active.");
+	ERR_FAIL_NULL_MSG(host, "The ENetConnection instance isn't currently active.");
 	enet_host_refuse_new_connections(host, p_refuse);
 	enet_host_refuse_new_connections(host, p_refuse);
 #else
 #else
 	ERR_FAIL_MSG("ENet DTLS support not available in this build.");
 	ERR_FAIL_MSG("ENet DTLS support not available in this build.");
@@ -294,7 +294,7 @@ void ENetConnection::refuse_new_connections(bool p_refuse) {
 
 
 Error ENetConnection::dtls_client_setup(const String &p_hostname, const Ref<TLSOptions> &p_options) {
 Error ENetConnection::dtls_client_setup(const String &p_hostname, const Ref<TLSOptions> &p_options) {
 #ifdef GODOT_ENET
 #ifdef GODOT_ENET
-	ERR_FAIL_COND_V_MSG(!host, ERR_UNCONFIGURED, "The ENetConnection instance isn't currently active.");
+	ERR_FAIL_NULL_V_MSG(host, ERR_UNCONFIGURED, "The ENetConnection instance isn't currently active.");
 	ERR_FAIL_COND_V(p_options.is_null() || p_options->is_server(), ERR_INVALID_PARAMETER);
 	ERR_FAIL_COND_V(p_options.is_null() || p_options->is_server(), ERR_INVALID_PARAMETER);
 	return enet_host_dtls_client_setup(host, p_hostname.utf8().get_data(), const_cast<TLSOptions *>(p_options.ptr())) ? FAILED : OK;
 	return enet_host_dtls_client_setup(host, p_hostname.utf8().get_data(), const_cast<TLSOptions *>(p_options.ptr())) ? FAILED : OK;
 #else
 #else
@@ -315,7 +315,7 @@ Error ENetConnection::_create(ENetAddress *p_address, int p_max_peers, int p_max
 			p_in_bandwidth /* limit incoming bandwidth if > 0 */,
 			p_in_bandwidth /* limit incoming bandwidth if > 0 */,
 			p_out_bandwidth /* limit outgoing bandwidth if > 0 */);
 			p_out_bandwidth /* limit outgoing bandwidth if > 0 */);
 
 
-	ERR_FAIL_COND_V_MSG(!host, ERR_CANT_CREATE, "Couldn't create an ENet host.");
+	ERR_FAIL_NULL_V_MSG(host, ERR_CANT_CREATE, "Couldn't create an ENet host.");
 	return OK;
 	return OK;
 }
 }
 
 
@@ -335,7 +335,7 @@ Array ENetConnection::_service(int p_timeout) {
 }
 }
 
 
 void ENetConnection::_broadcast(int p_channel, PackedByteArray p_packet, int p_flags) {
 void ENetConnection::_broadcast(int p_channel, PackedByteArray p_packet, int p_flags) {
-	ERR_FAIL_COND_MSG(!host, "The ENetConnection instance isn't currently active.");
+	ERR_FAIL_NULL_MSG(host, "The ENetConnection instance isn't currently active.");
 	ERR_FAIL_COND_MSG(p_channel < 0 || p_channel > (int)host->channelLimit, "Invalid channel");
 	ERR_FAIL_COND_MSG(p_channel < 0 || p_channel > (int)host->channelLimit, "Invalid channel");
 	ERR_FAIL_COND_MSG(p_flags & ~ENetPacketPeer::FLAG_ALLOWED, "Invalid flags");
 	ERR_FAIL_COND_MSG(p_flags & ~ENetPacketPeer::FLAG_ALLOWED, "Invalid flags");
 	ENetPacket *pkt = enet_packet_create(p_packet.ptr(), p_packet.size(), p_flags);
 	ENetPacket *pkt = enet_packet_create(p_packet.ptr(), p_packet.size(), p_flags);
@@ -343,7 +343,7 @@ void ENetConnection::_broadcast(int p_channel, PackedByteArray p_packet, int p_f
 }
 }
 
 
 void ENetConnection::socket_send(const String &p_address, int p_port, const PackedByteArray &p_packet) {
 void ENetConnection::socket_send(const String &p_address, int p_port, const PackedByteArray &p_packet) {
-	ERR_FAIL_COND_MSG(!host, "The ENetConnection instance isn't currently active.");
+	ERR_FAIL_NULL_MSG(host, "The ENetConnection instance isn't currently active.");
 	ERR_FAIL_COND_MSG(!(host->socket), "The ENetConnection instance isn't currently bound");
 	ERR_FAIL_COND_MSG(!(host->socket), "The ENetConnection instance isn't currently bound");
 	ERR_FAIL_COND_MSG(p_port < 1 || p_port > 65535, "The remote port number must be between 1 and 65535 (inclusive).");
 	ERR_FAIL_COND_MSG(p_port < 1 || p_port > 65535, "The remote port number must be between 1 and 65535 (inclusive).");
 
 
@@ -497,7 +497,7 @@ size_t ENetConnection::Compressor::enet_decompress(void *context, const enet_uin
 }
 }
 
 
 void ENetConnection::Compressor::setup(ENetHost *p_host, CompressionMode p_mode) {
 void ENetConnection::Compressor::setup(ENetHost *p_host, CompressionMode p_mode) {
-	ERR_FAIL_COND(!p_host);
+	ERR_FAIL_NULL(p_host);
 	switch (p_mode) {
 	switch (p_mode) {
 		case COMPRESS_NONE: {
 		case COMPRESS_NONE: {
 			enet_host_compress(p_host, nullptr);
 			enet_host_compress(p_host, nullptr);

+ 18 - 18
modules/enet/enet_packet_peer.cpp

@@ -31,51 +31,51 @@
 #include "enet_packet_peer.h"
 #include "enet_packet_peer.h"
 
 
 void ENetPacketPeer::peer_disconnect(int p_data) {
 void ENetPacketPeer::peer_disconnect(int p_data) {
-	ERR_FAIL_COND(!peer);
+	ERR_FAIL_NULL(peer);
 	enet_peer_disconnect(peer, p_data);
 	enet_peer_disconnect(peer, p_data);
 }
 }
 
 
 void ENetPacketPeer::peer_disconnect_later(int p_data) {
 void ENetPacketPeer::peer_disconnect_later(int p_data) {
-	ERR_FAIL_COND(!peer);
+	ERR_FAIL_NULL(peer);
 	enet_peer_disconnect_later(peer, p_data);
 	enet_peer_disconnect_later(peer, p_data);
 }
 }
 
 
 void ENetPacketPeer::peer_disconnect_now(int p_data) {
 void ENetPacketPeer::peer_disconnect_now(int p_data) {
-	ERR_FAIL_COND(!peer);
+	ERR_FAIL_NULL(peer);
 	enet_peer_disconnect_now(peer, p_data);
 	enet_peer_disconnect_now(peer, p_data);
 	_on_disconnect();
 	_on_disconnect();
 }
 }
 
 
 void ENetPacketPeer::ping() {
 void ENetPacketPeer::ping() {
-	ERR_FAIL_COND(!peer);
+	ERR_FAIL_NULL(peer);
 	enet_peer_ping(peer);
 	enet_peer_ping(peer);
 }
 }
 
 
 void ENetPacketPeer::ping_interval(int p_interval) {
 void ENetPacketPeer::ping_interval(int p_interval) {
-	ERR_FAIL_COND(!peer);
+	ERR_FAIL_NULL(peer);
 	enet_peer_ping_interval(peer, p_interval);
 	enet_peer_ping_interval(peer, p_interval);
 }
 }
 
 
 int ENetPacketPeer::send(uint8_t p_channel, ENetPacket *p_packet) {
 int ENetPacketPeer::send(uint8_t p_channel, ENetPacket *p_packet) {
-	ERR_FAIL_COND_V(peer == nullptr, -1);
-	ERR_FAIL_COND_V(p_packet == nullptr, -1);
+	ERR_FAIL_NULL_V(peer, -1);
+	ERR_FAIL_NULL_V(p_packet, -1);
 	ERR_FAIL_COND_V_MSG(p_channel >= peer->channelCount, -1, vformat("Unable to send packet on channel %d, max channels: %d", p_channel, (int)peer->channelCount));
 	ERR_FAIL_COND_V_MSG(p_channel >= peer->channelCount, -1, vformat("Unable to send packet on channel %d, max channels: %d", p_channel, (int)peer->channelCount));
 	return enet_peer_send(peer, p_channel, p_packet);
 	return enet_peer_send(peer, p_channel, p_packet);
 }
 }
 
 
 void ENetPacketPeer::reset() {
 void ENetPacketPeer::reset() {
-	ERR_FAIL_COND_MSG(peer == nullptr, "Peer not connected");
+	ERR_FAIL_NULL_MSG(peer, "Peer not connected.");
 	enet_peer_reset(peer);
 	enet_peer_reset(peer);
 	_on_disconnect();
 	_on_disconnect();
 }
 }
 
 
 void ENetPacketPeer::throttle_configure(int p_interval, int p_acceleration, int p_deceleration) {
 void ENetPacketPeer::throttle_configure(int p_interval, int p_acceleration, int p_deceleration) {
-	ERR_FAIL_COND_MSG(peer == nullptr, "Peer not connected");
+	ERR_FAIL_NULL_MSG(peer, "Peer not connected.");
 	enet_peer_throttle_configure(peer, p_interval, p_acceleration, p_deceleration);
 	enet_peer_throttle_configure(peer, p_interval, p_acceleration, p_deceleration);
 }
 }
 
 
 void ENetPacketPeer::set_timeout(int p_timeout, int p_timeout_min, int p_timeout_max) {
 void ENetPacketPeer::set_timeout(int p_timeout, int p_timeout_min, int p_timeout_max) {
-	ERR_FAIL_COND_MSG(peer == nullptr, "Peer not connected");
+	ERR_FAIL_NULL_MSG(peer, "Peer not connected.");
 	ERR_FAIL_COND_MSG(p_timeout > p_timeout_min || p_timeout_min > p_timeout_max, "Timeout limit must be less than minimum timeout, which itself must be less than maximum timeout");
 	ERR_FAIL_COND_MSG(p_timeout > p_timeout_min || p_timeout_min > p_timeout_max, "Timeout limit must be less than minimum timeout, which itself must be less than maximum timeout");
 	enet_peer_timeout(peer, p_timeout, p_timeout_min, p_timeout_max);
 	enet_peer_timeout(peer, p_timeout, p_timeout_min, p_timeout_max);
 }
 }
@@ -89,7 +89,7 @@ int ENetPacketPeer::get_available_packet_count() const {
 }
 }
 
 
 Error ENetPacketPeer::get_packet(const uint8_t **r_buffer, int &r_buffer_size) {
 Error ENetPacketPeer::get_packet(const uint8_t **r_buffer, int &r_buffer_size) {
-	ERR_FAIL_COND_V(!peer, ERR_UNCONFIGURED);
+	ERR_FAIL_NULL_V(peer, ERR_UNCONFIGURED);
 	ERR_FAIL_COND_V(!packet_queue.size(), ERR_UNAVAILABLE);
 	ERR_FAIL_COND_V(!packet_queue.size(), ERR_UNAVAILABLE);
 	if (last_packet) {
 	if (last_packet) {
 		enet_packet_destroy(last_packet);
 		enet_packet_destroy(last_packet);
@@ -103,13 +103,13 @@ Error ENetPacketPeer::get_packet(const uint8_t **r_buffer, int &r_buffer_size) {
 }
 }
 
 
 Error ENetPacketPeer::put_packet(const uint8_t *p_buffer, int p_buffer_size) {
 Error ENetPacketPeer::put_packet(const uint8_t *p_buffer, int p_buffer_size) {
-	ERR_FAIL_COND_V(!peer, ERR_UNCONFIGURED);
+	ERR_FAIL_NULL_V(peer, ERR_UNCONFIGURED);
 	ENetPacket *packet = enet_packet_create(p_buffer, p_buffer_size, ENET_PACKET_FLAG_RELIABLE);
 	ENetPacket *packet = enet_packet_create(p_buffer, p_buffer_size, ENET_PACKET_FLAG_RELIABLE);
 	return send(0, packet) < 0 ? FAILED : OK;
 	return send(0, packet) < 0 ? FAILED : OK;
 }
 }
 
 
 IPAddress ENetPacketPeer::get_remote_address() const {
 IPAddress ENetPacketPeer::get_remote_address() const {
-	ERR_FAIL_COND_V(!peer, IPAddress());
+	ERR_FAIL_NULL_V(peer, IPAddress());
 	IPAddress out;
 	IPAddress out;
 #ifdef GODOT_ENET
 #ifdef GODOT_ENET
 	out.set_ipv6((uint8_t *)&(peer->address.host));
 	out.set_ipv6((uint8_t *)&(peer->address.host));
@@ -120,7 +120,7 @@ IPAddress ENetPacketPeer::get_remote_address() const {
 }
 }
 
 
 int ENetPacketPeer::get_remote_port() const {
 int ENetPacketPeer::get_remote_port() const {
-	ERR_FAIL_COND_V(!peer, 0);
+	ERR_FAIL_NULL_V(peer, 0);
 	return peer->address.port;
 	return peer->address.port;
 }
 }
 
 
@@ -129,7 +129,7 @@ bool ENetPacketPeer::is_active() const {
 }
 }
 
 
 double ENetPacketPeer::get_statistic(PeerStatistic p_stat) {
 double ENetPacketPeer::get_statistic(PeerStatistic p_stat) {
-	ERR_FAIL_COND_V(!peer, 0);
+	ERR_FAIL_NULL_V(peer, 0);
 	switch (p_stat) {
 	switch (p_stat) {
 		case PEER_PACKET_LOSS:
 		case PEER_PACKET_LOSS:
 			return peer->packetLoss;
 			return peer->packetLoss;
@@ -171,7 +171,7 @@ ENetPacketPeer::PeerState ENetPacketPeer::get_state() const {
 }
 }
 
 
 int ENetPacketPeer::get_channels() const {
 int ENetPacketPeer::get_channels() const {
-	ERR_FAIL_COND_V_MSG(!peer, 0, "The ENetConnection instance isn't currently active.");
+	ERR_FAIL_NULL_V_MSG(peer, 0, "The ENetConnection instance isn't currently active.");
 	return peer->channelCount;
 	return peer->channelCount;
 }
 }
 
 
@@ -183,12 +183,12 @@ void ENetPacketPeer::_on_disconnect() {
 }
 }
 
 
 void ENetPacketPeer::_queue_packet(ENetPacket *p_packet) {
 void ENetPacketPeer::_queue_packet(ENetPacket *p_packet) {
-	ERR_FAIL_COND(!peer);
+	ERR_FAIL_NULL(peer);
 	packet_queue.push_back(p_packet);
 	packet_queue.push_back(p_packet);
 }
 }
 
 
 Error ENetPacketPeer::_send(int p_channel, PackedByteArray p_packet, int p_flags) {
 Error ENetPacketPeer::_send(int p_channel, PackedByteArray p_packet, int p_flags) {
-	ERR_FAIL_COND_V_MSG(peer == nullptr, ERR_UNCONFIGURED, "Peer not connected");
+	ERR_FAIL_NULL_V_MSG(peer, ERR_UNCONFIGURED, "Peer not connected.");
 	ERR_FAIL_COND_V_MSG(p_channel < 0 || p_channel > (int)peer->channelCount, ERR_INVALID_PARAMETER, "Invalid channel");
 	ERR_FAIL_COND_V_MSG(p_channel < 0 || p_channel > (int)peer->channelCount, ERR_INVALID_PARAMETER, "Invalid channel");
 	ERR_FAIL_COND_V_MSG(p_flags & ~FLAG_ALLOWED, ERR_INVALID_PARAMETER, "Invalid flags");
 	ERR_FAIL_COND_V_MSG(p_flags & ~FLAG_ALLOWED, ERR_INVALID_PARAMETER, "Invalid flags");
 	ENetPacket *packet = enet_packet_create(p_packet.ptr(), p_packet.size(), p_flags);
 	ENetPacket *packet = enet_packet_create(p_packet.ptr(), p_packet.size(), p_flags);

+ 2 - 2
modules/gdscript/gdscript.cpp

@@ -83,7 +83,7 @@ void GDScriptNativeClass::_bind_methods() {
 
 
 Variant GDScriptNativeClass::_new() {
 Variant GDScriptNativeClass::_new() {
 	Object *o = instantiate();
 	Object *o = instantiate();
-	ERR_FAIL_COND_V_MSG(!o, Variant(), "Class type: '" + String(name) + "' is not instantiable.");
+	ERR_FAIL_NULL_V_MSG(o, Variant(), "Class type: '" + String(name) + "' is not instantiable.");
 
 
 	RefCounted *rc = Object::cast_to<RefCounted>(o);
 	RefCounted *rc = Object::cast_to<RefCounted>(o);
 	if (rc) {
 	if (rc) {
@@ -215,7 +215,7 @@ Variant GDScript::_new(const Variant **p_args, int p_argcount, Callable::CallErr
 	} else {
 	} else {
 		owner = memnew(RefCounted); //by default, no base means use reference
 		owner = memnew(RefCounted); //by default, no base means use reference
 	}
 	}
-	ERR_FAIL_COND_V_MSG(!owner, Variant(), "Can't inherit from a virtual class.");
+	ERR_FAIL_NULL_V_MSG(owner, Variant(), "Can't inherit from a virtual class.");
 
 
 	RefCounted *r = Object::cast_to<RefCounted>(owner);
 	RefCounted *r = Object::cast_to<RefCounted>(owner);
 	if (r) {
 	if (r) {

+ 1 - 1
modules/gdscript/gdscript_analyzer.cpp

@@ -1419,7 +1419,7 @@ void GDScriptAnalyzer::resolve_class_body(GDScriptParser::ClassNode *p_class, bo
 }
 }
 
 
 void GDScriptAnalyzer::resolve_node(GDScriptParser::Node *p_node, bool p_is_root) {
 void GDScriptAnalyzer::resolve_node(GDScriptParser::Node *p_node, bool p_is_root) {
-	ERR_FAIL_COND_MSG(p_node == nullptr, "Trying to resolve type of a null node.");
+	ERR_FAIL_NULL_MSG(p_node, "Trying to resolve type of a null node.");
 
 
 	switch (p_node->type) {
 	switch (p_node->type) {
 		case GDScriptParser::Node::NONE:
 		case GDScriptParser::Node::NONE:

+ 1 - 1
modules/gdscript/gdscript_cache.cpp

@@ -59,7 +59,7 @@ GDScriptAnalyzer *GDScriptParserRef::get_analyzer() {
 }
 }
 
 
 Error GDScriptParserRef::raise_status(Status p_new_status) {
 Error GDScriptParserRef::raise_status(Status p_new_status) {
-	ERR_FAIL_COND_V(parser == nullptr, ERR_INVALID_DATA);
+	ERR_FAIL_NULL_V(parser, ERR_INVALID_DATA);
 
 
 	if (result != OK) {
 	if (result != OK) {
 		return result;
 		return result;

+ 1 - 1
modules/gdscript/gdscript_compiler.cpp

@@ -60,7 +60,7 @@ bool GDScriptCompiler::_is_class_member_property(GDScript *owner, const StringNa
 		scr = scr->_base;
 		scr = scr->_base;
 	}
 	}
 
 
-	ERR_FAIL_COND_V(!nc, false);
+	ERR_FAIL_NULL_V(nc, false);
 
 
 	return ClassDB::has_property(nc->get_name(), p_name);
 	return ClassDB::has_property(nc->get_name(), p_name);
 }
 }

+ 1 - 1
modules/gdscript/gdscript_function.cpp

@@ -188,7 +188,7 @@ bool GDScriptFunctionState::is_valid(bool p_extended_check) const {
 }
 }
 
 
 Variant GDScriptFunctionState::resume(const Variant &p_arg) {
 Variant GDScriptFunctionState::resume(const Variant &p_arg) {
-	ERR_FAIL_COND_V(!function, Variant());
+	ERR_FAIL_NULL_V(function, Variant());
 	{
 	{
 		MutexLock lock(GDScriptLanguage::singleton->mutex);
 		MutexLock lock(GDScriptLanguage::singleton->mutex);
 
 

+ 1 - 1
modules/gdscript/gdscript_function.h

@@ -152,7 +152,7 @@ public:
 	}
 	}
 
 
 	GDScriptDataType get_container_element_type() const {
 	GDScriptDataType get_container_element_type() const {
-		ERR_FAIL_COND_V(container_element_type == nullptr, GDScriptDataType());
+		ERR_FAIL_NULL_V(container_element_type, GDScriptDataType());
 		return *container_element_type;
 		return *container_element_type;
 	}
 	}
 
 

+ 1 - 1
modules/gdscript/gdscript_parser.cpp

@@ -170,7 +170,7 @@ void GDScriptParser::push_error(const String &p_message, const Node *p_origin) {
 
 
 #ifdef DEBUG_ENABLED
 #ifdef DEBUG_ENABLED
 void GDScriptParser::push_warning(const Node *p_source, GDScriptWarning::Code p_code, const Vector<String> &p_symbols) {
 void GDScriptParser::push_warning(const Node *p_source, GDScriptWarning::Code p_code, const Vector<String> &p_symbols) {
-	ERR_FAIL_COND(p_source == nullptr);
+	ERR_FAIL_NULL(p_source);
 	if (is_ignoring_warnings) {
 	if (is_ignoring_warnings) {
 		return;
 		return;
 	}
 	}

+ 1 - 1
modules/gdscript/gdscript_parser.h

@@ -156,7 +156,7 @@ public:
 		}
 		}
 
 
 		_FORCE_INLINE_ DataType get_container_element_type() const {
 		_FORCE_INLINE_ DataType get_container_element_type() const {
-			ERR_FAIL_COND_V(container_element_type == nullptr, DataType());
+			ERR_FAIL_NULL_V(container_element_type, DataType());
 			return *container_element_type;
 			return *container_element_type;
 		}
 		}
 
 

+ 1 - 1
modules/gdscript/gdscript_rpc_callable.cpp

@@ -78,7 +78,7 @@ GDScriptRPCCallable::GDScriptRPCCallable(Object *p_object, const StringName &p_m
 	h = method.hash();
 	h = method.hash();
 	h = hash_murmur3_one_64(object->get_instance_id(), h);
 	h = hash_murmur3_one_64(object->get_instance_id(), h);
 	node = Object::cast_to<Node>(object);
 	node = Object::cast_to<Node>(object);
-	ERR_FAIL_COND_MSG(!node, "RPC can only be defined on class that extends Node.");
+	ERR_FAIL_NULL_MSG(node, "RPC can only be defined on class that extends Node.");
 }
 }
 
 
 Error GDScriptRPCCallable::rpc(int p_peer_id, const Variant **p_arguments, int p_argcount, Callable::CallError &r_call_error) const {
 Error GDScriptRPCCallable::rpc(int p_peer_id, const Variant **p_arguments, int p_argcount, Callable::CallError &r_call_error) const {

+ 9 - 9
modules/gdscript/gdscript_utility_functions.cpp

@@ -729,50 +729,50 @@ void GDScriptUtilityFunctions::unregister_functions() {
 
 
 GDScriptUtilityFunctions::FunctionPtr GDScriptUtilityFunctions::get_function(const StringName &p_function) {
 GDScriptUtilityFunctions::FunctionPtr GDScriptUtilityFunctions::get_function(const StringName &p_function) {
 	GDScriptUtilityFunctionInfo *info = utility_function_table.lookup_ptr(p_function);
 	GDScriptUtilityFunctionInfo *info = utility_function_table.lookup_ptr(p_function);
-	ERR_FAIL_COND_V(!info, nullptr);
+	ERR_FAIL_NULL_V(info, nullptr);
 	return info->function;
 	return info->function;
 }
 }
 
 
 bool GDScriptUtilityFunctions::has_function_return_value(const StringName &p_function) {
 bool GDScriptUtilityFunctions::has_function_return_value(const StringName &p_function) {
 	GDScriptUtilityFunctionInfo *info = utility_function_table.lookup_ptr(p_function);
 	GDScriptUtilityFunctionInfo *info = utility_function_table.lookup_ptr(p_function);
-	ERR_FAIL_COND_V(!info, false);
+	ERR_FAIL_NULL_V(info, false);
 	return info->info.return_val.type != Variant::NIL || bool(info->info.return_val.usage & PROPERTY_USAGE_NIL_IS_VARIANT);
 	return info->info.return_val.type != Variant::NIL || bool(info->info.return_val.usage & PROPERTY_USAGE_NIL_IS_VARIANT);
 }
 }
 
 
 Variant::Type GDScriptUtilityFunctions::get_function_return_type(const StringName &p_function) {
 Variant::Type GDScriptUtilityFunctions::get_function_return_type(const StringName &p_function) {
 	GDScriptUtilityFunctionInfo *info = utility_function_table.lookup_ptr(p_function);
 	GDScriptUtilityFunctionInfo *info = utility_function_table.lookup_ptr(p_function);
-	ERR_FAIL_COND_V(!info, Variant::NIL);
+	ERR_FAIL_NULL_V(info, Variant::NIL);
 	return info->info.return_val.type;
 	return info->info.return_val.type;
 }
 }
 
 
 StringName GDScriptUtilityFunctions::get_function_return_class(const StringName &p_function) {
 StringName GDScriptUtilityFunctions::get_function_return_class(const StringName &p_function) {
 	GDScriptUtilityFunctionInfo *info = utility_function_table.lookup_ptr(p_function);
 	GDScriptUtilityFunctionInfo *info = utility_function_table.lookup_ptr(p_function);
-	ERR_FAIL_COND_V(!info, StringName());
+	ERR_FAIL_NULL_V(info, StringName());
 	return info->info.return_val.class_name;
 	return info->info.return_val.class_name;
 }
 }
 
 
 Variant::Type GDScriptUtilityFunctions::get_function_argument_type(const StringName &p_function, int p_arg) {
 Variant::Type GDScriptUtilityFunctions::get_function_argument_type(const StringName &p_function, int p_arg) {
 	GDScriptUtilityFunctionInfo *info = utility_function_table.lookup_ptr(p_function);
 	GDScriptUtilityFunctionInfo *info = utility_function_table.lookup_ptr(p_function);
-	ERR_FAIL_COND_V(!info, Variant::NIL);
+	ERR_FAIL_NULL_V(info, Variant::NIL);
 	ERR_FAIL_COND_V(p_arg >= info->info.arguments.size(), Variant::NIL);
 	ERR_FAIL_COND_V(p_arg >= info->info.arguments.size(), Variant::NIL);
 	return info->info.arguments[p_arg].type;
 	return info->info.arguments[p_arg].type;
 }
 }
 
 
 int GDScriptUtilityFunctions::get_function_argument_count(const StringName &p_function, int p_arg) {
 int GDScriptUtilityFunctions::get_function_argument_count(const StringName &p_function, int p_arg) {
 	GDScriptUtilityFunctionInfo *info = utility_function_table.lookup_ptr(p_function);
 	GDScriptUtilityFunctionInfo *info = utility_function_table.lookup_ptr(p_function);
-	ERR_FAIL_COND_V(!info, 0);
+	ERR_FAIL_NULL_V(info, 0);
 	return info->info.arguments.size();
 	return info->info.arguments.size();
 }
 }
 
 
 bool GDScriptUtilityFunctions::is_function_vararg(const StringName &p_function) {
 bool GDScriptUtilityFunctions::is_function_vararg(const StringName &p_function) {
 	GDScriptUtilityFunctionInfo *info = utility_function_table.lookup_ptr(p_function);
 	GDScriptUtilityFunctionInfo *info = utility_function_table.lookup_ptr(p_function);
-	ERR_FAIL_COND_V(!info, false);
+	ERR_FAIL_NULL_V(info, false);
 	return (bool)(info->info.flags & METHOD_FLAG_VARARG);
 	return (bool)(info->info.flags & METHOD_FLAG_VARARG);
 }
 }
 
 
 bool GDScriptUtilityFunctions::is_function_constant(const StringName &p_function) {
 bool GDScriptUtilityFunctions::is_function_constant(const StringName &p_function) {
 	GDScriptUtilityFunctionInfo *info = utility_function_table.lookup_ptr(p_function);
 	GDScriptUtilityFunctionInfo *info = utility_function_table.lookup_ptr(p_function);
-	ERR_FAIL_COND_V(!info, false);
+	ERR_FAIL_NULL_V(info, false);
 	return info->is_constant;
 	return info->is_constant;
 }
 }
 
 
@@ -788,6 +788,6 @@ void GDScriptUtilityFunctions::get_function_list(List<StringName> *r_functions)
 
 
 MethodInfo GDScriptUtilityFunctions::get_function_info(const StringName &p_function) {
 MethodInfo GDScriptUtilityFunctions::get_function_info(const StringName &p_function) {
 	GDScriptUtilityFunctionInfo *info = utility_function_table.lookup_ptr(p_function);
 	GDScriptUtilityFunctionInfo *info = utility_function_table.lookup_ptr(p_function);
-	ERR_FAIL_COND_V(!info, MethodInfo());
+	ERR_FAIL_NULL_V(info, MethodInfo());
 	return info->info;
 	return info->info;
 }
 }

+ 2 - 2
modules/gdscript/language_server/gdscript_language_protocol.cpp

@@ -290,7 +290,7 @@ void GDScriptLanguageProtocol::notify_client(const String &p_method, const Varia
 	}
 	}
 	ERR_FAIL_COND(!clients.has(p_client_id));
 	ERR_FAIL_COND(!clients.has(p_client_id));
 	Ref<LSPeer> peer = clients.get(p_client_id);
 	Ref<LSPeer> peer = clients.get(p_client_id);
-	ERR_FAIL_COND(peer == nullptr);
+	ERR_FAIL_NULL(peer);
 
 
 	Dictionary message = make_notification(p_method, p_params);
 	Dictionary message = make_notification(p_method, p_params);
 	String msg = Variant(message).to_json_string();
 	String msg = Variant(message).to_json_string();
@@ -311,7 +311,7 @@ void GDScriptLanguageProtocol::request_client(const String &p_method, const Vari
 	}
 	}
 	ERR_FAIL_COND(!clients.has(p_client_id));
 	ERR_FAIL_COND(!clients.has(p_client_id));
 	Ref<LSPeer> peer = clients.get(p_client_id);
 	Ref<LSPeer> peer = clients.get(p_client_id);
-	ERR_FAIL_COND(peer == nullptr);
+	ERR_FAIL_NULL(peer);
 
 
 	Dictionary message = make_request(p_method, p_params, next_server_id);
 	Dictionary message = make_request(p_method, p_params, next_server_id);
 	next_server_id++;
 	next_server_id++;

+ 1 - 1
modules/gltf/extensions/gltf_light.cpp

@@ -111,7 +111,7 @@ void GLTFLight::set_outer_cone_angle(float p_outer_cone_angle) {
 Ref<GLTFLight> GLTFLight::from_node(const Light3D *p_light) {
 Ref<GLTFLight> GLTFLight::from_node(const Light3D *p_light) {
 	Ref<GLTFLight> l;
 	Ref<GLTFLight> l;
 	l.instantiate();
 	l.instantiate();
-	ERR_FAIL_COND_V_MSG(!p_light, l, "Tried to create a GLTFLight from a Light3D node, but the given node was null.");
+	ERR_FAIL_NULL_V_MSG(p_light, l, "Tried to create a GLTFLight from a Light3D node, but the given node was null.");
 	l->color = p_light->get_color();
 	l->color = p_light->get_color();
 	if (cast_to<DirectionalLight3D>(p_light)) {
 	if (cast_to<DirectionalLight3D>(p_light)) {
 		l->light_type = "directional";
 		l->light_type = "directional";

+ 1 - 1
modules/gltf/extensions/physics/gltf_physics_body.cpp

@@ -112,7 +112,7 @@ void GLTFPhysicsBody::set_inertia_tensor(Basis p_inertia_tensor) {
 Ref<GLTFPhysicsBody> GLTFPhysicsBody::from_node(const CollisionObject3D *p_body_node) {
 Ref<GLTFPhysicsBody> GLTFPhysicsBody::from_node(const CollisionObject3D *p_body_node) {
 	Ref<GLTFPhysicsBody> physics_body;
 	Ref<GLTFPhysicsBody> physics_body;
 	physics_body.instantiate();
 	physics_body.instantiate();
-	ERR_FAIL_COND_V_MSG(!p_body_node, physics_body, "Tried to create a GLTFPhysicsBody from a CollisionObject3D node, but the given node was null.");
+	ERR_FAIL_NULL_V_MSG(p_body_node, physics_body, "Tried to create a GLTFPhysicsBody from a CollisionObject3D node, but the given node was null.");
 	if (cast_to<CharacterBody3D>(p_body_node)) {
 	if (cast_to<CharacterBody3D>(p_body_node)) {
 		physics_body->body_type = "character";
 		physics_body->body_type = "character";
 	} else if (cast_to<AnimatableBody3D>(p_body_node)) {
 	} else if (cast_to<AnimatableBody3D>(p_body_node)) {

+ 6 - 6
modules/gltf/gltf_document.cpp

@@ -5594,7 +5594,7 @@ void GLTFDocument::_create_gltf_node(Ref<GLTFState> p_state, Node *p_scene_paren
 }
 }
 
 
 void GLTFDocument::_convert_animation_player_to_gltf(AnimationPlayer *p_animation_player, Ref<GLTFState> p_state, GLTFNodeIndex p_gltf_current, GLTFNodeIndex p_gltf_root_index, Ref<GLTFNode> p_gltf_node, Node *p_scene_parent) {
 void GLTFDocument::_convert_animation_player_to_gltf(AnimationPlayer *p_animation_player, Ref<GLTFState> p_state, GLTFNodeIndex p_gltf_current, GLTFNodeIndex p_gltf_root_index, Ref<GLTFNode> p_gltf_node, Node *p_scene_parent) {
-	ERR_FAIL_COND(!p_animation_player);
+	ERR_FAIL_NULL(p_animation_player);
 	p_state->animation_players.push_back(p_animation_player);
 	p_state->animation_players.push_back(p_animation_player);
 	print_verbose(String("glTF: Converting animation player: ") + p_animation_player->get_name());
 	print_verbose(String("glTF: Converting animation player: ") + p_animation_player->get_name());
 }
 }
@@ -5613,7 +5613,7 @@ void GLTFDocument::_check_visibility(Node *p_node, bool &r_retflag) {
 }
 }
 
 
 void GLTFDocument::_convert_camera_to_gltf(Camera3D *camera, Ref<GLTFState> p_state, Ref<GLTFNode> p_gltf_node) {
 void GLTFDocument::_convert_camera_to_gltf(Camera3D *camera, Ref<GLTFState> p_state, Ref<GLTFNode> p_gltf_node) {
-	ERR_FAIL_COND(!camera);
+	ERR_FAIL_NULL(camera);
 	GLTFCameraIndex camera_index = _convert_camera(p_state, camera);
 	GLTFCameraIndex camera_index = _convert_camera(p_state, camera);
 	if (camera_index != -1) {
 	if (camera_index != -1) {
 		p_gltf_node->camera = camera_index;
 		p_gltf_node->camera = camera_index;
@@ -5621,7 +5621,7 @@ void GLTFDocument::_convert_camera_to_gltf(Camera3D *camera, Ref<GLTFState> p_st
 }
 }
 
 
 void GLTFDocument::_convert_light_to_gltf(Light3D *light, Ref<GLTFState> p_state, Ref<GLTFNode> p_gltf_node) {
 void GLTFDocument::_convert_light_to_gltf(Light3D *light, Ref<GLTFState> p_state, Ref<GLTFNode> p_gltf_node) {
-	ERR_FAIL_COND(!light);
+	ERR_FAIL_NULL(light);
 	GLTFLightIndex light_index = _convert_light(p_state, light);
 	GLTFLightIndex light_index = _convert_light(p_state, light);
 	if (light_index != -1) {
 	if (light_index != -1) {
 		p_gltf_node->light = light_index;
 		p_gltf_node->light = light_index;
@@ -5663,7 +5663,7 @@ void GLTFDocument::_convert_multi_mesh_instance_to_gltf(
 		GLTFNodeIndex p_parent_node_index,
 		GLTFNodeIndex p_parent_node_index,
 		GLTFNodeIndex p_root_node_index,
 		GLTFNodeIndex p_root_node_index,
 		Ref<GLTFNode> p_gltf_node, Ref<GLTFState> p_state) {
 		Ref<GLTFNode> p_gltf_node, Ref<GLTFState> p_state) {
-	ERR_FAIL_COND(!p_multi_mesh_instance);
+	ERR_FAIL_NULL(p_multi_mesh_instance);
 	Ref<MultiMesh> multi_mesh = p_multi_mesh_instance->get_multimesh();
 	Ref<MultiMesh> multi_mesh = p_multi_mesh_instance->get_multimesh();
 	if (multi_mesh.is_null()) {
 	if (multi_mesh.is_null()) {
 		return;
 		return;
@@ -6141,7 +6141,7 @@ void GLTFDocument::_import_animation(Ref<GLTFState> p_state, AnimationPlayer *p_
 		const Ref<GLTFNode> gltf_node = p_state->nodes[track_i.key];
 		const Ref<GLTFNode> gltf_node = p_state->nodes[track_i.key];
 
 
 		Node *root = p_animation_player->get_parent();
 		Node *root = p_animation_player->get_parent();
-		ERR_FAIL_COND(root == nullptr);
+		ERR_FAIL_NULL(root);
 		HashMap<GLTFNodeIndex, Node *>::Iterator node_element = p_state->scene_nodes.find(node_index);
 		HashMap<GLTFNodeIndex, Node *>::Iterator node_element = p_state->scene_nodes.find(node_index);
 		ERR_CONTINUE_MSG(!node_element, vformat("Unable to find node %d for animation.", node_index));
 		ERR_CONTINUE_MSG(!node_element, vformat("Unable to find node %d for animation.", node_index));
 		node_path = root->get_path_to(node_element->value);
 		node_path = root->get_path_to(node_element->value);
@@ -6154,7 +6154,7 @@ void GLTFDocument::_import_animation(Ref<GLTFState> p_state, AnimationPlayer *p_
 
 
 		if (gltf_node->skeleton >= 0) {
 		if (gltf_node->skeleton >= 0) {
 			const Skeleton3D *sk = p_state->skeletons[gltf_node->skeleton]->godot_skeleton;
 			const Skeleton3D *sk = p_state->skeletons[gltf_node->skeleton]->godot_skeleton;
-			ERR_FAIL_COND(sk == nullptr);
+			ERR_FAIL_NULL(sk);
 
 
 			const String path = p_animation_player->get_parent()->get_path_to(sk);
 			const String path = p_animation_player->get_parent()->get_path_to(sk);
 			const String bone = gltf_node->get_name();
 			const String bone = gltf_node->get_name();

+ 1 - 1
modules/gltf/structures/gltf_camera.cpp

@@ -60,7 +60,7 @@ void GLTFCamera::_bind_methods() {
 Ref<GLTFCamera> GLTFCamera::from_node(const Camera3D *p_camera) {
 Ref<GLTFCamera> GLTFCamera::from_node(const Camera3D *p_camera) {
 	Ref<GLTFCamera> c;
 	Ref<GLTFCamera> c;
 	c.instantiate();
 	c.instantiate();
-	ERR_FAIL_COND_V_MSG(!p_camera, c, "Tried to create a GLTFCamera from a Camera3D node, but the given node was null.");
+	ERR_FAIL_NULL_V_MSG(p_camera, c, "Tried to create a GLTFCamera from a Camera3D node, but the given node was null.");
 	c->set_perspective(p_camera->get_projection() == Camera3D::ProjectionType::PROJECTION_PERSPECTIVE);
 	c->set_perspective(p_camera->get_projection() == Camera3D::ProjectionType::PROJECTION_PERSPECTIVE);
 	// GLTF spec (yfov) is in radians, Godot's camera (fov) is in degrees.
 	// GLTF spec (yfov) is in radians, Godot's camera (fov) is in degrees.
 	c->set_fov(Math::deg_to_rad(p_camera->get_fov()));
 	c->set_fov(Math::deg_to_rad(p_camera->get_fov()));

+ 3 - 3
modules/mbedtls/crypto_mbedtls.cpp

@@ -256,7 +256,7 @@ Error HMACContextMbedTLS::start(HashingContext::HashType p_hash_type, PackedByte
 }
 }
 
 
 Error HMACContextMbedTLS::update(PackedByteArray p_data) {
 Error HMACContextMbedTLS::update(PackedByteArray p_data) {
-	ERR_FAIL_COND_V_MSG(ctx == nullptr, ERR_INVALID_DATA, "Start must be called before update.");
+	ERR_FAIL_NULL_V_MSG(ctx, ERR_INVALID_DATA, "Start must be called before update.");
 
 
 	ERR_FAIL_COND_V_MSG(p_data.is_empty(), ERR_INVALID_PARAMETER, "Src must not be empty.");
 	ERR_FAIL_COND_V_MSG(p_data.is_empty(), ERR_INVALID_PARAMETER, "Src must not be empty.");
 
 
@@ -265,7 +265,7 @@ Error HMACContextMbedTLS::update(PackedByteArray p_data) {
 }
 }
 
 
 PackedByteArray HMACContextMbedTLS::finish() {
 PackedByteArray HMACContextMbedTLS::finish() {
-	ERR_FAIL_COND_V_MSG(ctx == nullptr, PackedByteArray(), "Start must be called before finish.");
+	ERR_FAIL_NULL_V_MSG(ctx, PackedByteArray(), "Start must be called before finish.");
 	ERR_FAIL_COND_V_MSG(hash_len == 0, PackedByteArray(), "Unsupported hash type.");
 	ERR_FAIL_COND_V_MSG(hash_len == 0, PackedByteArray(), "Unsupported hash type.");
 
 
 	PackedByteArray out;
 	PackedByteArray out;
@@ -342,7 +342,7 @@ void CryptoMbedTLS::load_default_certificates(String p_path) {
 	ERR_FAIL_COND(default_certs != nullptr);
 	ERR_FAIL_COND(default_certs != nullptr);
 
 
 	default_certs = memnew(X509CertificateMbedTLS);
 	default_certs = memnew(X509CertificateMbedTLS);
-	ERR_FAIL_COND(default_certs == nullptr);
+	ERR_FAIL_NULL(default_certs);
 
 
 	if (!p_path.is_empty()) {
 	if (!p_path.is_empty()) {
 		// Use certs defined in project settings.
 		// Use certs defined in project settings.

+ 2 - 2
modules/mbedtls/packet_peer_mbed_dtls.cpp

@@ -40,7 +40,7 @@ int PacketPeerMbedDTLS::bio_send(void *ctx, const unsigned char *buf, size_t len
 
 
 	PacketPeerMbedDTLS *sp = static_cast<PacketPeerMbedDTLS *>(ctx);
 	PacketPeerMbedDTLS *sp = static_cast<PacketPeerMbedDTLS *>(ctx);
 
 
-	ERR_FAIL_COND_V(sp == nullptr, 0);
+	ERR_FAIL_NULL_V(sp, 0);
 
 
 	Error err = sp->base->put_packet((const uint8_t *)buf, len);
 	Error err = sp->base->put_packet((const uint8_t *)buf, len);
 	if (err == ERR_BUSY) {
 	if (err == ERR_BUSY) {
@@ -58,7 +58,7 @@ int PacketPeerMbedDTLS::bio_recv(void *ctx, unsigned char *buf, size_t len) {
 
 
 	PacketPeerMbedDTLS *sp = static_cast<PacketPeerMbedDTLS *>(ctx);
 	PacketPeerMbedDTLS *sp = static_cast<PacketPeerMbedDTLS *>(ctx);
 
 
-	ERR_FAIL_COND_V(sp == nullptr, 0);
+	ERR_FAIL_NULL_V(sp, 0);
 
 
 	int pc = sp->base->get_available_packet_count();
 	int pc = sp->base->get_available_packet_count();
 	if (pc == 0) {
 	if (pc == 0) {

+ 2 - 2
modules/mbedtls/stream_peer_mbedtls.cpp

@@ -40,7 +40,7 @@ int StreamPeerMbedTLS::bio_send(void *ctx, const unsigned char *buf, size_t len)
 
 
 	StreamPeerMbedTLS *sp = static_cast<StreamPeerMbedTLS *>(ctx);
 	StreamPeerMbedTLS *sp = static_cast<StreamPeerMbedTLS *>(ctx);
 
 
-	ERR_FAIL_COND_V(sp == nullptr, 0);
+	ERR_FAIL_NULL_V(sp, 0);
 
 
 	int sent;
 	int sent;
 	Error err = sp->base->put_partial_data((const uint8_t *)buf, len, sent);
 	Error err = sp->base->put_partial_data((const uint8_t *)buf, len, sent);
@@ -60,7 +60,7 @@ int StreamPeerMbedTLS::bio_recv(void *ctx, unsigned char *buf, size_t len) {
 
 
 	StreamPeerMbedTLS *sp = static_cast<StreamPeerMbedTLS *>(ctx);
 	StreamPeerMbedTLS *sp = static_cast<StreamPeerMbedTLS *>(ctx);
 
 
-	ERR_FAIL_COND_V(sp == nullptr, 0);
+	ERR_FAIL_NULL_V(sp, 0);
 
 
 	int got;
 	int got;
 	Error err = sp->base->get_partial_data((uint8_t *)buf, len, got);
 	Error err = sp->base->get_partial_data((uint8_t *)buf, len, got);

+ 1 - 1
modules/mono/class_db_api_json.cpp

@@ -47,7 +47,7 @@ void class_db_api_to_json(const String &p_output_file, ClassDB::APIType p_api) {
 
 
 	for (const StringName &E : class_list) {
 	for (const StringName &E : class_list) {
 		ClassDB::ClassInfo *t = ClassDB::classes.getptr(E);
 		ClassDB::ClassInfo *t = ClassDB::classes.getptr(E);
-		ERR_FAIL_COND(!t);
+		ERR_FAIL_NULL(t);
 		if (t->api != p_api || !t->exposed) {
 		if (t->api != p_api || !t->exposed) {
 			continue;
 			continue;
 		}
 		}

+ 1 - 1
modules/mono/mono_gd/gd_mono_cache.cpp

@@ -42,7 +42,7 @@ void update_godot_api_cache(const ManagedCallbacks &p_managed_callbacks) {
 
 
 #define CHECK_CALLBACK_NOT_NULL_IMPL(m_var, m_class, m_method)                             \
 #define CHECK_CALLBACK_NOT_NULL_IMPL(m_var, m_class, m_method)                             \
 	{                                                                                      \
 	{                                                                                      \
-		ERR_FAIL_COND_MSG(m_var == nullptr,                                                \
+		ERR_FAIL_NULL_MSG(m_var,                                                           \
 				"Mono Cache: Managed callback for '" #m_class "_" #m_method "' is null."); \
 				"Mono Cache: Managed callback for '" #m_class "_" #m_method "' is null."); \
 		checked_count += 1;                                                                \
 		checked_count += 1;                                                                \
 	}
 	}

+ 2 - 2
modules/multiplayer/editor/replication_editor.cpp

@@ -112,9 +112,9 @@ void ReplicationEditor::_pick_node_filter_input(const Ref<InputEvent> &p_ie) {
 
 
 void ReplicationEditor::_pick_node_selected(NodePath p_path) {
 void ReplicationEditor::_pick_node_selected(NodePath p_path) {
 	Node *root = current->get_node(current->get_root_path());
 	Node *root = current->get_node(current->get_root_path());
-	ERR_FAIL_COND(!root);
+	ERR_FAIL_NULL(root);
 	Node *node = get_node(p_path);
 	Node *node = get_node(p_path);
-	ERR_FAIL_COND(!node);
+	ERR_FAIL_NULL(node);
 	NodePath path_to = root->get_path_to(node);
 	NodePath path_to = root->get_path_to(node);
 	adding_node_path = path_to;
 	adding_node_path = path_to;
 	prop_selector->select_property_from_instance(node);
 	prop_selector->select_property_from_instance(node);

+ 2 - 2
modules/multiplayer/multiplayer_debugger.cpp

@@ -237,7 +237,7 @@ void MultiplayerDebugger::RPCProfiler::tick(double p_frame_time, double p_proces
 // ReplicationProfiler
 // ReplicationProfiler
 
 
 MultiplayerDebugger::SyncInfo::SyncInfo(MultiplayerSynchronizer *p_sync) {
 MultiplayerDebugger::SyncInfo::SyncInfo(MultiplayerSynchronizer *p_sync) {
-	ERR_FAIL_COND(!p_sync);
+	ERR_FAIL_NULL(p_sync);
 	synchronizer = p_sync->get_instance_id();
 	synchronizer = p_sync->get_instance_id();
 	if (p_sync->get_replication_config().is_valid()) {
 	if (p_sync->get_replication_config().is_valid()) {
 		config = p_sync->get_replication_config()->get_instance_id();
 		config = p_sync->get_replication_config()->get_instance_id();
@@ -305,7 +305,7 @@ void MultiplayerDebugger::ReplicationProfiler::add(const Array &p_data) {
 	const ObjectID id = p_data[1];
 	const ObjectID id = p_data[1];
 	const uint64_t size = p_data[2];
 	const uint64_t size = p_data[2];
 	MultiplayerSynchronizer *sync = Object::cast_to<MultiplayerSynchronizer>(ObjectDB::get_instance(id));
 	MultiplayerSynchronizer *sync = Object::cast_to<MultiplayerSynchronizer>(ObjectDB::get_instance(id));
-	ERR_FAIL_COND(!sync);
+	ERR_FAIL_NULL(sync);
 	if (!sync_data.has(id)) {
 	if (!sync_data.has(id)) {
 		sync_data[id] = SyncInfo(sync);
 		sync_data[id] = SyncInfo(sync);
 	}
 	}

+ 3 - 3
modules/multiplayer/multiplayer_spawner.cpp

@@ -268,7 +268,7 @@ void MultiplayerSpawner::_spawn_notify(ObjectID p_id) {
 
 
 void MultiplayerSpawner::_node_exit(ObjectID p_id) {
 void MultiplayerSpawner::_node_exit(ObjectID p_id) {
 	Node *node = Object::cast_to<Node>(ObjectDB::get_instance(p_id));
 	Node *node = Object::cast_to<Node>(ObjectDB::get_instance(p_id));
-	ERR_FAIL_COND(!node);
+	ERR_FAIL_NULL(node);
 	if (tracked_nodes.has(p_id)) {
 	if (tracked_nodes.has(p_id)) {
 		tracked_nodes.erase(p_id);
 		tracked_nodes.erase(p_id);
 		get_multiplayer()->object_configuration_remove(node, this);
 		get_multiplayer()->object_configuration_remove(node, this);
@@ -323,10 +323,10 @@ Node *MultiplayerSpawner::spawn(const Variant &p_data) {
 	ERR_FAIL_COND_V_MSG(!spawn_function.is_valid(), nullptr, "Custom spawn requires the 'spawn_function' property to be a valid callable.");
 	ERR_FAIL_COND_V_MSG(!spawn_function.is_valid(), nullptr, "Custom spawn requires the 'spawn_function' property to be a valid callable.");
 
 
 	Node *parent = get_spawn_node();
 	Node *parent = get_spawn_node();
-	ERR_FAIL_COND_V_MSG(!parent, nullptr, "Cannot find spawn node.");
+	ERR_FAIL_NULL_V_MSG(parent, nullptr, "Cannot find spawn node.");
 
 
 	Node *node = instantiate_custom(p_data);
 	Node *node = instantiate_custom(p_data);
-	ERR_FAIL_COND_V_MSG(!node, nullptr, "The 'spawn_function' callable must return a valid node.");
+	ERR_FAIL_NULL_V_MSG(node, nullptr, "The 'spawn_function' callable must return a valid node.");
 
 
 	_track(node, p_data);
 	_track(node, p_data);
 	parent->add_child(node, true);
 	parent->add_child(node, true);

+ 5 - 5
modules/multiplayer/multiplayer_synchronizer.cpp

@@ -149,14 +149,14 @@ PackedStringArray MultiplayerSynchronizer::get_configuration_warnings() const {
 }
 }
 
 
 Error MultiplayerSynchronizer::get_state(const List<NodePath> &p_properties, Object *p_obj, Vector<Variant> &r_variant, Vector<const Variant *> &r_variant_ptrs) {
 Error MultiplayerSynchronizer::get_state(const List<NodePath> &p_properties, Object *p_obj, Vector<Variant> &r_variant, Vector<const Variant *> &r_variant_ptrs) {
-	ERR_FAIL_COND_V(!p_obj, ERR_INVALID_PARAMETER);
+	ERR_FAIL_NULL_V(p_obj, ERR_INVALID_PARAMETER);
 	r_variant.resize(p_properties.size());
 	r_variant.resize(p_properties.size());
 	r_variant_ptrs.resize(r_variant.size());
 	r_variant_ptrs.resize(r_variant.size());
 	int i = 0;
 	int i = 0;
 	for (const NodePath &prop : p_properties) {
 	for (const NodePath &prop : p_properties) {
 		bool valid = false;
 		bool valid = false;
 		const Object *obj = _get_prop_target(p_obj, prop);
 		const Object *obj = _get_prop_target(p_obj, prop);
-		ERR_FAIL_COND_V(!obj, FAILED);
+		ERR_FAIL_NULL_V(obj, FAILED);
 		r_variant.write[i] = obj->get_indexed(prop.get_subnames(), &valid);
 		r_variant.write[i] = obj->get_indexed(prop.get_subnames(), &valid);
 		r_variant_ptrs.write[i] = &r_variant[i];
 		r_variant_ptrs.write[i] = &r_variant[i];
 		ERR_FAIL_COND_V_MSG(!valid, ERR_INVALID_DATA, vformat("Property '%s' not found.", prop));
 		ERR_FAIL_COND_V_MSG(!valid, ERR_INVALID_DATA, vformat("Property '%s' not found.", prop));
@@ -166,11 +166,11 @@ Error MultiplayerSynchronizer::get_state(const List<NodePath> &p_properties, Obj
 }
 }
 
 
 Error MultiplayerSynchronizer::set_state(const List<NodePath> &p_properties, Object *p_obj, const Vector<Variant> &p_state) {
 Error MultiplayerSynchronizer::set_state(const List<NodePath> &p_properties, Object *p_obj, const Vector<Variant> &p_state) {
-	ERR_FAIL_COND_V(!p_obj, ERR_INVALID_PARAMETER);
+	ERR_FAIL_NULL_V(p_obj, ERR_INVALID_PARAMETER);
 	int i = 0;
 	int i = 0;
 	for (const NodePath &prop : p_properties) {
 	for (const NodePath &prop : p_properties) {
 		Object *obj = _get_prop_target(p_obj, prop);
 		Object *obj = _get_prop_target(p_obj, prop);
-		ERR_FAIL_COND_V(!obj, FAILED);
+		ERR_FAIL_NULL_V(obj, FAILED);
 		obj->set_indexed(prop.get_subnames(), p_state[i]);
 		obj->set_indexed(prop.get_subnames(), p_state[i]);
 		i += 1;
 		i += 1;
 	}
 	}
@@ -374,7 +374,7 @@ Error MultiplayerSynchronizer::_watch_changes(uint64_t p_usec) {
 		return OK;
 		return OK;
 	}
 	}
 	Node *node = get_root_node();
 	Node *node = get_root_node();
-	ERR_FAIL_COND_V(!node, FAILED);
+	ERR_FAIL_NULL_V(node, FAILED);
 	int idx = -1;
 	int idx = -1;
 	Watcher *ptr = watchers.ptrw();
 	Watcher *ptr = watchers.ptrw();
 	for (const NodePath &prop : props) {
 	for (const NodePath &prop : props) {

+ 7 - 7
modules/multiplayer/scene_cache_interface.cpp

@@ -53,7 +53,7 @@ void SceneCacheInterface::on_peer_change(int p_id, bool p_connected) {
 
 
 void SceneCacheInterface::process_simplify_path(int p_from, const uint8_t *p_packet, int p_packet_len) {
 void SceneCacheInterface::process_simplify_path(int p_from, const uint8_t *p_packet, int p_packet_len) {
 	Node *root_node = SceneTree::get_singleton()->get_root()->get_node(multiplayer->get_root_path());
 	Node *root_node = SceneTree::get_singleton()->get_root()->get_node(multiplayer->get_root_path());
-	ERR_FAIL_COND(!root_node);
+	ERR_FAIL_NULL(root_node);
 	ERR_FAIL_COND_MSG(p_packet_len < 38, "Invalid packet received. Size too small.");
 	ERR_FAIL_COND_MSG(p_packet_len < 38, "Invalid packet received. Size too small.");
 	int ofs = 1;
 	int ofs = 1;
 
 
@@ -74,7 +74,7 @@ void SceneCacheInterface::process_simplify_path(int p_from, const uint8_t *p_pac
 	}
 	}
 
 
 	Node *node = root_node->get_node(path);
 	Node *node = root_node->get_node(path);
-	ERR_FAIL_COND(node == nullptr);
+	ERR_FAIL_NULL(node);
 	const bool valid_rpc_checksum = multiplayer->get_rpc_md5(node) == methods_md5;
 	const bool valid_rpc_checksum = multiplayer->get_rpc_md5(node) == methods_md5;
 	if (valid_rpc_checksum == false) {
 	if (valid_rpc_checksum == false) {
 		ERR_PRINT("The rpc node checksum failed. Make sure to have the same methods on both nodes. Node path: " + path);
 		ERR_PRINT("The rpc node checksum failed. Make sure to have the same methods on both nodes. Node path: " + path);
@@ -119,7 +119,7 @@ void SceneCacheInterface::process_confirm_path(int p_from, const uint8_t *p_pack
 	}
 	}
 
 
 	PathSentCache *psc = path_send_cache.getptr(path);
 	PathSentCache *psc = path_send_cache.getptr(path);
-	ERR_FAIL_COND_MSG(!psc, "Invalid packet received. Tries to confirm a path which was not found in cache.");
+	ERR_FAIL_NULL_MSG(psc, "Invalid packet received. Tries to confirm a path which was not found in cache.");
 
 
 	HashMap<int, bool>::Iterator E = psc->confirmed_peers.find(p_from);
 	HashMap<int, bool>::Iterator E = psc->confirmed_peers.find(p_from);
 	ERR_FAIL_COND_MSG(!E, "Invalid packet received. Source peer was not found in cache for the given path.");
 	ERR_FAIL_COND_MSG(!E, "Invalid packet received. Source peer was not found in cache for the given path.");
@@ -165,7 +165,7 @@ Error SceneCacheInterface::_send_confirm_path(Node *p_node, NodePath p_path, Pat
 
 
 bool SceneCacheInterface::is_cache_confirmed(NodePath p_path, int p_peer) {
 bool SceneCacheInterface::is_cache_confirmed(NodePath p_path, int p_peer) {
 	const PathSentCache *psc = path_send_cache.getptr(p_path);
 	const PathSentCache *psc = path_send_cache.getptr(p_path);
-	ERR_FAIL_COND_V(!psc, false);
+	ERR_FAIL_NULL_V(psc, false);
 	HashMap<int, bool>::ConstIterator F = psc->confirmed_peers.find(p_peer);
 	HashMap<int, bool>::ConstIterator F = psc->confirmed_peers.find(p_peer);
 	ERR_FAIL_COND_V(!F, false); // Should never happen.
 	ERR_FAIL_COND_V(!F, false); // Should never happen.
 	return F->value;
 	return F->value;
@@ -173,7 +173,7 @@ bool SceneCacheInterface::is_cache_confirmed(NodePath p_path, int p_peer) {
 
 
 int SceneCacheInterface::make_object_cache(Object *p_obj) {
 int SceneCacheInterface::make_object_cache(Object *p_obj) {
 	Node *node = Object::cast_to<Node>(p_obj);
 	Node *node = Object::cast_to<Node>(p_obj);
-	ERR_FAIL_COND_V(!node, -1);
+	ERR_FAIL_NULL_V(node, -1);
 	NodePath for_path = multiplayer->get_root_path().rel_path_to(node->get_path());
 	NodePath for_path = multiplayer->get_root_path().rel_path_to(node->get_path());
 	// See if the path is cached.
 	// See if the path is cached.
 	PathSentCache *psc = path_send_cache.getptr(for_path);
 	PathSentCache *psc = path_send_cache.getptr(for_path);
@@ -188,7 +188,7 @@ int SceneCacheInterface::make_object_cache(Object *p_obj) {
 
 
 bool SceneCacheInterface::send_object_cache(Object *p_obj, int p_peer_id, int &r_id) {
 bool SceneCacheInterface::send_object_cache(Object *p_obj, int p_peer_id, int &r_id) {
 	Node *node = Object::cast_to<Node>(p_obj);
 	Node *node = Object::cast_to<Node>(p_obj);
-	ERR_FAIL_COND_V(!node, false);
+	ERR_FAIL_NULL_V(node, false);
 
 
 	r_id = make_object_cache(p_obj);
 	r_id = make_object_cache(p_obj);
 	ERR_FAIL_COND_V(r_id < 0, false);
 	ERR_FAIL_COND_V(r_id < 0, false);
@@ -233,7 +233,7 @@ bool SceneCacheInterface::send_object_cache(Object *p_obj, int p_peer_id, int &r
 
 
 Object *SceneCacheInterface::get_cached_object(int p_from, uint32_t p_cache_id) {
 Object *SceneCacheInterface::get_cached_object(int p_from, uint32_t p_cache_id) {
 	Node *root_node = SceneTree::get_singleton()->get_root()->get_node(multiplayer->get_root_path());
 	Node *root_node = SceneTree::get_singleton()->get_root()->get_node(multiplayer->get_root_path());
-	ERR_FAIL_COND_V(!root_node, nullptr);
+	ERR_FAIL_NULL_V(root_node, nullptr);
 	HashMap<int, PathGetCache>::Iterator E = path_get_cache.find(p_from);
 	HashMap<int, PathGetCache>::Iterator E = path_get_cache.find(p_from);
 	ERR_FAIL_COND_V_MSG(!E, nullptr, vformat("No cache found for peer %d.", p_from));
 	ERR_FAIL_COND_V_MSG(!E, nullptr, vformat("No cache found for peer %d.", p_from));
 
 

+ 14 - 14
modules/multiplayer/scene_replication_interface.cpp

@@ -155,7 +155,7 @@ Error SceneReplicationInterface::on_spawn(Object *p_obj, Variant p_config) {
 	Node *node = Object::cast_to<Node>(p_obj);
 	Node *node = Object::cast_to<Node>(p_obj);
 	ERR_FAIL_COND_V(!node || p_config.get_type() != Variant::OBJECT, ERR_INVALID_PARAMETER);
 	ERR_FAIL_COND_V(!node || p_config.get_type() != Variant::OBJECT, ERR_INVALID_PARAMETER);
 	MultiplayerSpawner *spawner = Object::cast_to<MultiplayerSpawner>(p_config.get_validated_object());
 	MultiplayerSpawner *spawner = Object::cast_to<MultiplayerSpawner>(p_config.get_validated_object());
-	ERR_FAIL_COND_V(!spawner, ERR_INVALID_PARAMETER);
+	ERR_FAIL_NULL_V(spawner, ERR_INVALID_PARAMETER);
 	// Track node.
 	// Track node.
 	const ObjectID oid = node->get_instance_id();
 	const ObjectID oid = node->get_instance_id();
 	TrackedNode &tobj = _track(oid);
 	TrackedNode &tobj = _track(oid);
@@ -226,7 +226,7 @@ Error SceneReplicationInterface::on_replication_start(Object *p_obj, Variant p_c
 	Node *node = Object::cast_to<Node>(p_obj);
 	Node *node = Object::cast_to<Node>(p_obj);
 	ERR_FAIL_COND_V(!node || p_config.get_type() != Variant::OBJECT, ERR_INVALID_PARAMETER);
 	ERR_FAIL_COND_V(!node || p_config.get_type() != Variant::OBJECT, ERR_INVALID_PARAMETER);
 	MultiplayerSynchronizer *sync = Object::cast_to<MultiplayerSynchronizer>(p_config.get_validated_object());
 	MultiplayerSynchronizer *sync = Object::cast_to<MultiplayerSynchronizer>(p_config.get_validated_object());
-	ERR_FAIL_COND_V(!sync, ERR_INVALID_PARAMETER);
+	ERR_FAIL_NULL_V(sync, ERR_INVALID_PARAMETER);
 
 
 	// Add to synchronizer list.
 	// Add to synchronizer list.
 	TrackedNode &tobj = _track(p_obj->get_instance_id());
 	TrackedNode &tobj = _track(p_obj->get_instance_id());
@@ -270,7 +270,7 @@ Error SceneReplicationInterface::on_replication_stop(Object *p_obj, Variant p_co
 	Node *node = Object::cast_to<Node>(p_obj);
 	Node *node = Object::cast_to<Node>(p_obj);
 	ERR_FAIL_COND_V(!node || p_config.get_type() != Variant::OBJECT, ERR_INVALID_PARAMETER);
 	ERR_FAIL_COND_V(!node || p_config.get_type() != Variant::OBJECT, ERR_INVALID_PARAMETER);
 	MultiplayerSynchronizer *sync = Object::cast_to<MultiplayerSynchronizer>(p_config.get_validated_object());
 	MultiplayerSynchronizer *sync = Object::cast_to<MultiplayerSynchronizer>(p_config.get_validated_object());
-	ERR_FAIL_COND_V(!sync, ERR_INVALID_PARAMETER);
+	ERR_FAIL_NULL_V(sync, ERR_INVALID_PARAMETER);
 	sync->disconnect("visibility_changed", callable_mp(this, &SceneReplicationInterface::_visibility_changed));
 	sync->disconnect("visibility_changed", callable_mp(this, &SceneReplicationInterface::_visibility_changed));
 	// Untrack synchronizer.
 	// Untrack synchronizer.
 	const ObjectID oid = node->get_instance_id();
 	const ObjectID oid = node->get_instance_id();
@@ -291,9 +291,9 @@ Error SceneReplicationInterface::on_replication_stop(Object *p_obj, Variant p_co
 
 
 void SceneReplicationInterface::_visibility_changed(int p_peer, ObjectID p_sid) {
 void SceneReplicationInterface::_visibility_changed(int p_peer, ObjectID p_sid) {
 	MultiplayerSynchronizer *sync = get_id_as<MultiplayerSynchronizer>(p_sid);
 	MultiplayerSynchronizer *sync = get_id_as<MultiplayerSynchronizer>(p_sid);
-	ERR_FAIL_COND(!sync); // Bug.
+	ERR_FAIL_NULL(sync); // Bug.
 	Node *node = sync->get_root_node();
 	Node *node = sync->get_root_node();
-	ERR_FAIL_COND(!node); // Bug.
+	ERR_FAIL_NULL(node); // Bug.
 	const ObjectID oid = node->get_instance_id();
 	const ObjectID oid = node->get_instance_id();
 	if (spawned_nodes.has(oid) && p_peer != multiplayer->get_unique_id()) {
 	if (spawned_nodes.has(oid) && p_peer != multiplayer->get_unique_id()) {
 		_update_spawn_visibility(p_peer, oid);
 		_update_spawn_visibility(p_peer, oid);
@@ -341,7 +341,7 @@ bool SceneReplicationInterface::is_rpc_visible(const ObjectID &p_oid, int p_peer
 }
 }
 
 
 Error SceneReplicationInterface::_update_sync_visibility(int p_peer, MultiplayerSynchronizer *p_sync) {
 Error SceneReplicationInterface::_update_sync_visibility(int p_peer, MultiplayerSynchronizer *p_sync) {
-	ERR_FAIL_COND_V(!p_sync, ERR_BUG);
+	ERR_FAIL_NULL_V(p_sync, ERR_BUG);
 	if (!multiplayer->has_multiplayer_peer() || !p_sync->is_multiplayer_authority() || p_peer == multiplayer->get_unique_id()) {
 	if (!multiplayer->has_multiplayer_peer() || !p_sync->is_multiplayer_authority() || p_peer == multiplayer->get_unique_id()) {
 		return OK;
 		return OK;
 	}
 	}
@@ -380,7 +380,7 @@ Error SceneReplicationInterface::_update_sync_visibility(int p_peer, Multiplayer
 
 
 Error SceneReplicationInterface::_update_spawn_visibility(int p_peer, const ObjectID &p_oid) {
 Error SceneReplicationInterface::_update_spawn_visibility(int p_peer, const ObjectID &p_oid) {
 	const TrackedNode *tnode = tracked_nodes.getptr(p_oid);
 	const TrackedNode *tnode = tracked_nodes.getptr(p_oid);
-	ERR_FAIL_COND_V(!tnode, ERR_BUG);
+	ERR_FAIL_NULL_V(tnode, ERR_BUG);
 	MultiplayerSpawner *spawner = get_id_as<MultiplayerSpawner>(tnode->spawner);
 	MultiplayerSpawner *spawner = get_id_as<MultiplayerSpawner>(tnode->spawner);
 	Node *node = get_id_as<Node>(p_oid);
 	Node *node = get_id_as<Node>(p_oid);
 	ERR_FAIL_COND_V(!node || !spawner || !spawner->is_multiplayer_authority(), ERR_BUG);
 	ERR_FAIL_COND_V(!node || !spawner || !spawner->is_multiplayer_authority(), ERR_BUG);
@@ -467,7 +467,7 @@ Error SceneReplicationInterface::_make_spawn_packet(Node *p_node, MultiplayerSpa
 
 
 	const ObjectID oid = p_node->get_instance_id();
 	const ObjectID oid = p_node->get_instance_id();
 	const TrackedNode *tnode = tracked_nodes.getptr(oid);
 	const TrackedNode *tnode = tracked_nodes.getptr(oid);
-	ERR_FAIL_COND_V(!tnode, ERR_INVALID_PARAMETER);
+	ERR_FAIL_NULL_V(tnode, ERR_INVALID_PARAMETER);
 
 
 	uint32_t nid = tnode->net_id;
 	uint32_t nid = tnode->net_id;
 	ERR_FAIL_COND_V(!nid, ERR_UNCONFIGURED);
 	ERR_FAIL_COND_V(!nid, ERR_UNCONFIGURED);
@@ -549,7 +549,7 @@ Error SceneReplicationInterface::_make_spawn_packet(Node *p_node, MultiplayerSpa
 Error SceneReplicationInterface::_make_despawn_packet(Node *p_node, int &r_len) {
 Error SceneReplicationInterface::_make_despawn_packet(Node *p_node, int &r_len) {
 	const ObjectID oid = p_node->get_instance_id();
 	const ObjectID oid = p_node->get_instance_id();
 	const TrackedNode *tnode = tracked_nodes.getptr(oid);
 	const TrackedNode *tnode = tracked_nodes.getptr(oid);
-	ERR_FAIL_COND_V(!tnode, ERR_INVALID_PARAMETER);
+	ERR_FAIL_NULL_V(tnode, ERR_INVALID_PARAMETER);
 	MAKE_ROOM(5);
 	MAKE_ROOM(5);
 	uint8_t *ptr = packet_cache.ptrw();
 	uint8_t *ptr = packet_cache.ptrw();
 	ptr[0] = (uint8_t)SceneMultiplayer::NETWORK_COMMAND_DESPAWN;
 	ptr[0] = (uint8_t)SceneMultiplayer::NETWORK_COMMAND_DESPAWN;
@@ -568,7 +568,7 @@ Error SceneReplicationInterface::on_spawn_receive(int p_from, const uint8_t *p_b
 	uint32_t node_target = decode_uint32(&p_buffer[ofs]);
 	uint32_t node_target = decode_uint32(&p_buffer[ofs]);
 	ofs += 4;
 	ofs += 4;
 	MultiplayerSpawner *spawner = Object::cast_to<MultiplayerSpawner>(multiplayer->get_path_cache()->get_cached_object(p_from, node_target));
 	MultiplayerSpawner *spawner = Object::cast_to<MultiplayerSpawner>(multiplayer->get_path_cache()->get_cached_object(p_from, node_target));
-	ERR_FAIL_COND_V(!spawner, ERR_DOES_NOT_EXIST);
+	ERR_FAIL_NULL_V(spawner, ERR_DOES_NOT_EXIST);
 	ERR_FAIL_COND_V(p_from != spawner->get_multiplayer_authority(), ERR_UNAUTHORIZED);
 	ERR_FAIL_COND_V(p_from != spawner->get_multiplayer_authority(), ERR_UNAUTHORIZED);
 
 
 	uint32_t net_id = decode_uint32(&p_buffer[ofs]);
 	uint32_t net_id = decode_uint32(&p_buffer[ofs]);
@@ -592,7 +592,7 @@ Error SceneReplicationInterface::on_spawn_receive(int p_from, const uint8_t *p_b
 
 
 	// Check that we can spawn.
 	// Check that we can spawn.
 	Node *parent = spawner->get_node_or_null(spawner->get_spawn_path());
 	Node *parent = spawner->get_node_or_null(spawner->get_spawn_path());
-	ERR_FAIL_COND_V(!parent, ERR_UNCONFIGURED);
+	ERR_FAIL_NULL_V(parent, ERR_UNCONFIGURED);
 	ERR_FAIL_COND_V(parent->has_node(name), ERR_INVALID_DATA);
 	ERR_FAIL_COND_V(parent->has_node(name), ERR_INVALID_DATA);
 
 
 	Node *node = nullptr;
 	Node *node = nullptr;
@@ -611,7 +611,7 @@ Error SceneReplicationInterface::on_spawn_receive(int p_from, const uint8_t *p_b
 		// Scene based spawn.
 		// Scene based spawn.
 		node = spawner->instantiate_scene(scene_id);
 		node = spawner->instantiate_scene(scene_id);
 	}
 	}
-	ERR_FAIL_COND_V(!node, ERR_UNAUTHORIZED);
+	ERR_FAIL_NULL_V(node, ERR_UNAUTHORIZED);
 	node->set_name(name);
 	node->set_name(name);
 
 
 	// Add and track remote
 	// Add and track remote
@@ -656,13 +656,13 @@ Error SceneReplicationInterface::on_despawn_receive(int p_from, const uint8_t *p
 	PeerInfo &pinfo = peers_info[p_from];
 	PeerInfo &pinfo = peers_info[p_from];
 	ERR_FAIL_COND_V(!pinfo.recv_nodes.has(net_id), ERR_UNAUTHORIZED);
 	ERR_FAIL_COND_V(!pinfo.recv_nodes.has(net_id), ERR_UNAUTHORIZED);
 	Node *node = get_id_as<Node>(pinfo.recv_nodes[net_id]);
 	Node *node = get_id_as<Node>(pinfo.recv_nodes[net_id]);
-	ERR_FAIL_COND_V(!node, ERR_BUG);
+	ERR_FAIL_NULL_V(node, ERR_BUG);
 	pinfo.recv_nodes.erase(net_id);
 	pinfo.recv_nodes.erase(net_id);
 
 
 	const ObjectID oid = node->get_instance_id();
 	const ObjectID oid = node->get_instance_id();
 	ERR_FAIL_COND_V(!tracked_nodes.has(oid), ERR_BUG);
 	ERR_FAIL_COND_V(!tracked_nodes.has(oid), ERR_BUG);
 	MultiplayerSpawner *spawner = get_id_as<MultiplayerSpawner>(tracked_nodes[oid].spawner);
 	MultiplayerSpawner *spawner = get_id_as<MultiplayerSpawner>(tracked_nodes[oid].spawner);
-	ERR_FAIL_COND_V(!spawner, ERR_DOES_NOT_EXIST);
+	ERR_FAIL_NULL_V(spawner, ERR_DOES_NOT_EXIST);
 	ERR_FAIL_COND_V(p_from != spawner->get_multiplayer_authority(), ERR_UNAUTHORIZED);
 	ERR_FAIL_COND_V(p_from != spawner->get_multiplayer_authority(), ERR_UNAUTHORIZED);
 
 
 	if (node->get_parent() != nullptr) {
 	if (node->get_parent() != nullptr) {

+ 3 - 3
modules/multiplayer/scene_rpc_interface.cpp

@@ -134,7 +134,7 @@ _FORCE_INLINE_ bool _can_call_mode(Node *p_node, MultiplayerAPI::RPCMode mode, i
 
 
 String SceneRPCInterface::get_rpc_md5(const Object *p_obj) {
 String SceneRPCInterface::get_rpc_md5(const Object *p_obj) {
 	const Node *node = Object::cast_to<Node>(p_obj);
 	const Node *node = Object::cast_to<Node>(p_obj);
-	ERR_FAIL_COND_V(!node, "");
+	ERR_FAIL_NULL_V(node, "");
 	const RPCConfigCache cache = _get_node_config(node);
 	const RPCConfigCache cache = _get_node_config(node);
 	String rpc_list;
 	String rpc_list;
 	for (const KeyValue<uint16_t, RPCConfig> &config : cache.configs) {
 	for (const KeyValue<uint16_t, RPCConfig> &config : cache.configs) {
@@ -145,7 +145,7 @@ String SceneRPCInterface::get_rpc_md5(const Object *p_obj) {
 
 
 Node *SceneRPCInterface::_process_get_node(int p_from, const uint8_t *p_packet, uint32_t p_node_target, int p_packet_len) {
 Node *SceneRPCInterface::_process_get_node(int p_from, const uint8_t *p_packet, uint32_t p_node_target, int p_packet_len) {
 	Node *root_node = SceneTree::get_singleton()->get_root()->get_node(multiplayer->get_root_path());
 	Node *root_node = SceneTree::get_singleton()->get_root()->get_node(multiplayer->get_root_path());
-	ERR_FAIL_COND_V(!root_node, nullptr);
+	ERR_FAIL_NULL_V(root_node, nullptr);
 	Node *node = nullptr;
 	Node *node = nullptr;
 
 
 	if (p_node_target & 0x80000000) {
 	if (p_node_target & 0x80000000) {
@@ -225,7 +225,7 @@ void SceneRPCInterface::process_rpc(int p_from, const uint8_t *p_packet, int p_p
 	}
 	}
 
 
 	Node *node = _process_get_node(p_from, p_packet, node_target, p_packet_len);
 	Node *node = _process_get_node(p_from, p_packet, node_target, p_packet_len);
-	ERR_FAIL_COND_MSG(node == nullptr, "Invalid packet received. Requested node was not found.");
+	ERR_FAIL_NULL_MSG(node, "Invalid packet received. Requested node was not found.");
 
 
 	uint16_t name_id = 0;
 	uint16_t name_id = 0;
 	switch (name_id_compression) {
 	switch (name_id_compression) {

+ 1 - 1
modules/navigation/editor/navigation_mesh_editor_plugin.cpp

@@ -64,7 +64,7 @@ void NavigationMeshEditor::_notification(int p_what) {
 void NavigationMeshEditor::_bake_pressed() {
 void NavigationMeshEditor::_bake_pressed() {
 	button_bake->set_pressed(false);
 	button_bake->set_pressed(false);
 
 
-	ERR_FAIL_COND(!node);
+	ERR_FAIL_NULL(node);
 	Ref<NavigationMesh> navmesh = node->get_navigation_mesh();
 	Ref<NavigationMesh> navmesh = node->get_navigation_mesh();
 	if (!navmesh.is_valid()) {
 	if (!navmesh.is_valid()) {
 		err_dialog->set_text(TTR("A NavigationMesh resource must be set or created for this node to work."));
 		err_dialog->set_text(TTR("A NavigationMesh resource must be set or created for this node to work."));

+ 102 - 102
modules/navigation/godot_navigation_server.cpp

@@ -116,7 +116,7 @@ RID GodotNavigationServer::map_create() {
 
 
 COMMAND_2(map_set_active, RID, p_map, bool, p_active) {
 COMMAND_2(map_set_active, RID, p_map, bool, p_active) {
 	NavMap *map = map_owner.get_or_null(p_map);
 	NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND(map == nullptr);
+	ERR_FAIL_NULL(map);
 
 
 	if (p_active) {
 	if (p_active) {
 		if (!map_is_active(p_map)) {
 		if (!map_is_active(p_map)) {
@@ -133,126 +133,126 @@ COMMAND_2(map_set_active, RID, p_map, bool, p_active) {
 
 
 bool GodotNavigationServer::map_is_active(RID p_map) const {
 bool GodotNavigationServer::map_is_active(RID p_map) const {
 	NavMap *map = map_owner.get_or_null(p_map);
 	NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND_V(map == nullptr, false);
+	ERR_FAIL_NULL_V(map, false);
 
 
 	return active_maps.find(map) >= 0;
 	return active_maps.find(map) >= 0;
 }
 }
 
 
 COMMAND_2(map_set_up, RID, p_map, Vector3, p_up) {
 COMMAND_2(map_set_up, RID, p_map, Vector3, p_up) {
 	NavMap *map = map_owner.get_or_null(p_map);
 	NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND(map == nullptr);
+	ERR_FAIL_NULL(map);
 
 
 	map->set_up(p_up);
 	map->set_up(p_up);
 }
 }
 
 
 Vector3 GodotNavigationServer::map_get_up(RID p_map) const {
 Vector3 GodotNavigationServer::map_get_up(RID p_map) const {
 	const NavMap *map = map_owner.get_or_null(p_map);
 	const NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND_V(map == nullptr, Vector3());
+	ERR_FAIL_NULL_V(map, Vector3());
 
 
 	return map->get_up();
 	return map->get_up();
 }
 }
 
 
 COMMAND_2(map_set_cell_size, RID, p_map, real_t, p_cell_size) {
 COMMAND_2(map_set_cell_size, RID, p_map, real_t, p_cell_size) {
 	NavMap *map = map_owner.get_or_null(p_map);
 	NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND(map == nullptr);
+	ERR_FAIL_NULL(map);
 
 
 	map->set_cell_size(p_cell_size);
 	map->set_cell_size(p_cell_size);
 }
 }
 
 
 real_t GodotNavigationServer::map_get_cell_size(RID p_map) const {
 real_t GodotNavigationServer::map_get_cell_size(RID p_map) const {
 	const NavMap *map = map_owner.get_or_null(p_map);
 	const NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND_V(map == nullptr, 0);
+	ERR_FAIL_NULL_V(map, 0);
 
 
 	return map->get_cell_size();
 	return map->get_cell_size();
 }
 }
 
 
 COMMAND_2(map_set_cell_height, RID, p_map, real_t, p_cell_height) {
 COMMAND_2(map_set_cell_height, RID, p_map, real_t, p_cell_height) {
 	NavMap *map = map_owner.get_or_null(p_map);
 	NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND(map == nullptr);
+	ERR_FAIL_NULL(map);
 
 
 	map->set_cell_height(p_cell_height);
 	map->set_cell_height(p_cell_height);
 }
 }
 
 
 real_t GodotNavigationServer::map_get_cell_height(RID p_map) const {
 real_t GodotNavigationServer::map_get_cell_height(RID p_map) const {
 	const NavMap *map = map_owner.get_or_null(p_map);
 	const NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND_V(map == nullptr, 0);
+	ERR_FAIL_NULL_V(map, 0);
 
 
 	return map->get_cell_height();
 	return map->get_cell_height();
 }
 }
 
 
 COMMAND_2(map_set_use_edge_connections, RID, p_map, bool, p_enabled) {
 COMMAND_2(map_set_use_edge_connections, RID, p_map, bool, p_enabled) {
 	NavMap *map = map_owner.get_or_null(p_map);
 	NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND(map == nullptr);
+	ERR_FAIL_NULL(map);
 
 
 	map->set_use_edge_connections(p_enabled);
 	map->set_use_edge_connections(p_enabled);
 }
 }
 
 
 bool GodotNavigationServer::map_get_use_edge_connections(RID p_map) const {
 bool GodotNavigationServer::map_get_use_edge_connections(RID p_map) const {
 	NavMap *map = map_owner.get_or_null(p_map);
 	NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND_V(map == nullptr, false);
+	ERR_FAIL_NULL_V(map, false);
 
 
 	return map->get_use_edge_connections();
 	return map->get_use_edge_connections();
 }
 }
 
 
 COMMAND_2(map_set_edge_connection_margin, RID, p_map, real_t, p_connection_margin) {
 COMMAND_2(map_set_edge_connection_margin, RID, p_map, real_t, p_connection_margin) {
 	NavMap *map = map_owner.get_or_null(p_map);
 	NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND(map == nullptr);
+	ERR_FAIL_NULL(map);
 
 
 	map->set_edge_connection_margin(p_connection_margin);
 	map->set_edge_connection_margin(p_connection_margin);
 }
 }
 
 
 real_t GodotNavigationServer::map_get_edge_connection_margin(RID p_map) const {
 real_t GodotNavigationServer::map_get_edge_connection_margin(RID p_map) const {
 	const NavMap *map = map_owner.get_or_null(p_map);
 	const NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND_V(map == nullptr, 0);
+	ERR_FAIL_NULL_V(map, 0);
 
 
 	return map->get_edge_connection_margin();
 	return map->get_edge_connection_margin();
 }
 }
 
 
 COMMAND_2(map_set_link_connection_radius, RID, p_map, real_t, p_connection_radius) {
 COMMAND_2(map_set_link_connection_radius, RID, p_map, real_t, p_connection_radius) {
 	NavMap *map = map_owner.get_or_null(p_map);
 	NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND(map == nullptr);
+	ERR_FAIL_NULL(map);
 
 
 	map->set_link_connection_radius(p_connection_radius);
 	map->set_link_connection_radius(p_connection_radius);
 }
 }
 
 
 real_t GodotNavigationServer::map_get_link_connection_radius(RID p_map) const {
 real_t GodotNavigationServer::map_get_link_connection_radius(RID p_map) const {
 	const NavMap *map = map_owner.get_or_null(p_map);
 	const NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND_V(map == nullptr, 0);
+	ERR_FAIL_NULL_V(map, 0);
 
 
 	return map->get_link_connection_radius();
 	return map->get_link_connection_radius();
 }
 }
 
 
 Vector<Vector3> GodotNavigationServer::map_get_path(RID p_map, Vector3 p_origin, Vector3 p_destination, bool p_optimize, uint32_t p_navigation_layers) const {
 Vector<Vector3> GodotNavigationServer::map_get_path(RID p_map, Vector3 p_origin, Vector3 p_destination, bool p_optimize, uint32_t p_navigation_layers) const {
 	const NavMap *map = map_owner.get_or_null(p_map);
 	const NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND_V(map == nullptr, Vector<Vector3>());
+	ERR_FAIL_NULL_V(map, Vector<Vector3>());
 
 
 	return map->get_path(p_origin, p_destination, p_optimize, p_navigation_layers, nullptr, nullptr, nullptr);
 	return map->get_path(p_origin, p_destination, p_optimize, p_navigation_layers, nullptr, nullptr, nullptr);
 }
 }
 
 
 Vector3 GodotNavigationServer::map_get_closest_point_to_segment(RID p_map, const Vector3 &p_from, const Vector3 &p_to, const bool p_use_collision) const {
 Vector3 GodotNavigationServer::map_get_closest_point_to_segment(RID p_map, const Vector3 &p_from, const Vector3 &p_to, const bool p_use_collision) const {
 	const NavMap *map = map_owner.get_or_null(p_map);
 	const NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND_V(map == nullptr, Vector3());
+	ERR_FAIL_NULL_V(map, Vector3());
 
 
 	return map->get_closest_point_to_segment(p_from, p_to, p_use_collision);
 	return map->get_closest_point_to_segment(p_from, p_to, p_use_collision);
 }
 }
 
 
 Vector3 GodotNavigationServer::map_get_closest_point(RID p_map, const Vector3 &p_point) const {
 Vector3 GodotNavigationServer::map_get_closest_point(RID p_map, const Vector3 &p_point) const {
 	const NavMap *map = map_owner.get_or_null(p_map);
 	const NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND_V(map == nullptr, Vector3());
+	ERR_FAIL_NULL_V(map, Vector3());
 
 
 	return map->get_closest_point(p_point);
 	return map->get_closest_point(p_point);
 }
 }
 
 
 Vector3 GodotNavigationServer::map_get_closest_point_normal(RID p_map, const Vector3 &p_point) const {
 Vector3 GodotNavigationServer::map_get_closest_point_normal(RID p_map, const Vector3 &p_point) const {
 	const NavMap *map = map_owner.get_or_null(p_map);
 	const NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND_V(map == nullptr, Vector3());
+	ERR_FAIL_NULL_V(map, Vector3());
 
 
 	return map->get_closest_point_normal(p_point);
 	return map->get_closest_point_normal(p_point);
 }
 }
 
 
 RID GodotNavigationServer::map_get_closest_point_owner(RID p_map, const Vector3 &p_point) const {
 RID GodotNavigationServer::map_get_closest_point_owner(RID p_map, const Vector3 &p_point) const {
 	const NavMap *map = map_owner.get_or_null(p_map);
 	const NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND_V(map == nullptr, RID());
+	ERR_FAIL_NULL_V(map, RID());
 
 
 	return map->get_closest_point_owner(p_point);
 	return map->get_closest_point_owner(p_point);
 }
 }
@@ -260,7 +260,7 @@ RID GodotNavigationServer::map_get_closest_point_owner(RID p_map, const Vector3
 TypedArray<RID> GodotNavigationServer::map_get_links(RID p_map) const {
 TypedArray<RID> GodotNavigationServer::map_get_links(RID p_map) const {
 	TypedArray<RID> link_rids;
 	TypedArray<RID> link_rids;
 	const NavMap *map = map_owner.get_or_null(p_map);
 	const NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND_V(map == nullptr, link_rids);
+	ERR_FAIL_NULL_V(map, link_rids);
 
 
 	const LocalVector<NavLink *> &links = map->get_links();
 	const LocalVector<NavLink *> &links = map->get_links();
 	link_rids.resize(links.size());
 	link_rids.resize(links.size());
@@ -274,7 +274,7 @@ TypedArray<RID> GodotNavigationServer::map_get_links(RID p_map) const {
 TypedArray<RID> GodotNavigationServer::map_get_regions(RID p_map) const {
 TypedArray<RID> GodotNavigationServer::map_get_regions(RID p_map) const {
 	TypedArray<RID> regions_rids;
 	TypedArray<RID> regions_rids;
 	const NavMap *map = map_owner.get_or_null(p_map);
 	const NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND_V(map == nullptr, regions_rids);
+	ERR_FAIL_NULL_V(map, regions_rids);
 
 
 	const LocalVector<NavRegion *> &regions = map->get_regions();
 	const LocalVector<NavRegion *> &regions = map->get_regions();
 	regions_rids.resize(regions.size());
 	regions_rids.resize(regions.size());
@@ -288,7 +288,7 @@ TypedArray<RID> GodotNavigationServer::map_get_regions(RID p_map) const {
 TypedArray<RID> GodotNavigationServer::map_get_agents(RID p_map) const {
 TypedArray<RID> GodotNavigationServer::map_get_agents(RID p_map) const {
 	TypedArray<RID> agents_rids;
 	TypedArray<RID> agents_rids;
 	const NavMap *map = map_owner.get_or_null(p_map);
 	const NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND_V(map == nullptr, agents_rids);
+	ERR_FAIL_NULL_V(map, agents_rids);
 
 
 	const LocalVector<NavAgent *> &agents = map->get_agents();
 	const LocalVector<NavAgent *> &agents = map->get_agents();
 	agents_rids.resize(agents.size());
 	agents_rids.resize(agents.size());
@@ -302,7 +302,7 @@ TypedArray<RID> GodotNavigationServer::map_get_agents(RID p_map) const {
 TypedArray<RID> GodotNavigationServer::map_get_obstacles(RID p_map) const {
 TypedArray<RID> GodotNavigationServer::map_get_obstacles(RID p_map) const {
 	TypedArray<RID> obstacles_rids;
 	TypedArray<RID> obstacles_rids;
 	const NavMap *map = map_owner.get_or_null(p_map);
 	const NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND_V(map == nullptr, obstacles_rids);
+	ERR_FAIL_NULL_V(map, obstacles_rids);
 	const LocalVector<NavObstacle *> obstacles = map->get_obstacles();
 	const LocalVector<NavObstacle *> obstacles = map->get_obstacles();
 	obstacles_rids.resize(obstacles.size());
 	obstacles_rids.resize(obstacles.size());
 	for (uint32_t i = 0; i < obstacles.size(); i++) {
 	for (uint32_t i = 0; i < obstacles.size(); i++) {
@@ -313,7 +313,7 @@ TypedArray<RID> GodotNavigationServer::map_get_obstacles(RID p_map) const {
 
 
 RID GodotNavigationServer::region_get_map(RID p_region) const {
 RID GodotNavigationServer::region_get_map(RID p_region) const {
 	NavRegion *region = region_owner.get_or_null(p_region);
 	NavRegion *region = region_owner.get_or_null(p_region);
-	ERR_FAIL_COND_V(region == nullptr, RID());
+	ERR_FAIL_NULL_V(region, RID());
 
 
 	if (region->get_map()) {
 	if (region->get_map()) {
 		return region->get_map()->get_self();
 		return region->get_map()->get_self();
@@ -323,7 +323,7 @@ RID GodotNavigationServer::region_get_map(RID p_region) const {
 
 
 RID GodotNavigationServer::agent_get_map(RID p_agent) const {
 RID GodotNavigationServer::agent_get_map(RID p_agent) const {
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND_V(agent == nullptr, RID());
+	ERR_FAIL_NULL_V(agent, RID());
 
 
 	if (agent->get_map()) {
 	if (agent->get_map()) {
 		return agent->get_map()->get_self();
 		return agent->get_map()->get_self();
@@ -342,35 +342,35 @@ RID GodotNavigationServer::region_create() {
 
 
 COMMAND_2(region_set_enabled, RID, p_region, bool, p_enabled) {
 COMMAND_2(region_set_enabled, RID, p_region, bool, p_enabled) {
 	NavRegion *region = region_owner.get_or_null(p_region);
 	NavRegion *region = region_owner.get_or_null(p_region);
-	ERR_FAIL_COND(region == nullptr);
+	ERR_FAIL_NULL(region);
 
 
 	region->set_enabled(p_enabled);
 	region->set_enabled(p_enabled);
 }
 }
 
 
 bool GodotNavigationServer::region_get_enabled(RID p_region) const {
 bool GodotNavigationServer::region_get_enabled(RID p_region) const {
 	const NavRegion *region = region_owner.get_or_null(p_region);
 	const NavRegion *region = region_owner.get_or_null(p_region);
-	ERR_FAIL_COND_V(region == nullptr, false);
+	ERR_FAIL_NULL_V(region, false);
 
 
 	return region->get_enabled();
 	return region->get_enabled();
 }
 }
 
 
 COMMAND_2(region_set_use_edge_connections, RID, p_region, bool, p_enabled) {
 COMMAND_2(region_set_use_edge_connections, RID, p_region, bool, p_enabled) {
 	NavRegion *region = region_owner.get_or_null(p_region);
 	NavRegion *region = region_owner.get_or_null(p_region);
-	ERR_FAIL_COND(region == nullptr);
+	ERR_FAIL_NULL(region);
 
 
 	region->set_use_edge_connections(p_enabled);
 	region->set_use_edge_connections(p_enabled);
 }
 }
 
 
 bool GodotNavigationServer::region_get_use_edge_connections(RID p_region) const {
 bool GodotNavigationServer::region_get_use_edge_connections(RID p_region) const {
 	NavRegion *region = region_owner.get_or_null(p_region);
 	NavRegion *region = region_owner.get_or_null(p_region);
-	ERR_FAIL_COND_V(region == nullptr, false);
+	ERR_FAIL_NULL_V(region, false);
 
 
 	return region->get_use_edge_connections();
 	return region->get_use_edge_connections();
 }
 }
 
 
 COMMAND_2(region_set_map, RID, p_region, RID, p_map) {
 COMMAND_2(region_set_map, RID, p_region, RID, p_map) {
 	NavRegion *region = region_owner.get_or_null(p_region);
 	NavRegion *region = region_owner.get_or_null(p_region);
-	ERR_FAIL_COND(region == nullptr);
+	ERR_FAIL_NULL(region);
 
 
 	NavMap *map = map_owner.get_or_null(p_map);
 	NavMap *map = map_owner.get_or_null(p_map);
 
 
@@ -379,14 +379,14 @@ COMMAND_2(region_set_map, RID, p_region, RID, p_map) {
 
 
 COMMAND_2(region_set_transform, RID, p_region, Transform3D, p_transform) {
 COMMAND_2(region_set_transform, RID, p_region, Transform3D, p_transform) {
 	NavRegion *region = region_owner.get_or_null(p_region);
 	NavRegion *region = region_owner.get_or_null(p_region);
-	ERR_FAIL_COND(region == nullptr);
+	ERR_FAIL_NULL(region);
 
 
 	region->set_transform(p_transform);
 	region->set_transform(p_transform);
 }
 }
 
 
 COMMAND_2(region_set_enter_cost, RID, p_region, real_t, p_enter_cost) {
 COMMAND_2(region_set_enter_cost, RID, p_region, real_t, p_enter_cost) {
 	NavRegion *region = region_owner.get_or_null(p_region);
 	NavRegion *region = region_owner.get_or_null(p_region);
-	ERR_FAIL_COND(region == nullptr);
+	ERR_FAIL_NULL(region);
 	ERR_FAIL_COND(p_enter_cost < 0.0);
 	ERR_FAIL_COND(p_enter_cost < 0.0);
 
 
 	region->set_enter_cost(p_enter_cost);
 	region->set_enter_cost(p_enter_cost);
@@ -394,14 +394,14 @@ COMMAND_2(region_set_enter_cost, RID, p_region, real_t, p_enter_cost) {
 
 
 real_t GodotNavigationServer::region_get_enter_cost(RID p_region) const {
 real_t GodotNavigationServer::region_get_enter_cost(RID p_region) const {
 	NavRegion *region = region_owner.get_or_null(p_region);
 	NavRegion *region = region_owner.get_or_null(p_region);
-	ERR_FAIL_COND_V(region == nullptr, 0);
+	ERR_FAIL_NULL_V(region, 0);
 
 
 	return region->get_enter_cost();
 	return region->get_enter_cost();
 }
 }
 
 
 COMMAND_2(region_set_travel_cost, RID, p_region, real_t, p_travel_cost) {
 COMMAND_2(region_set_travel_cost, RID, p_region, real_t, p_travel_cost) {
 	NavRegion *region = region_owner.get_or_null(p_region);
 	NavRegion *region = region_owner.get_or_null(p_region);
-	ERR_FAIL_COND(region == nullptr);
+	ERR_FAIL_NULL(region);
 	ERR_FAIL_COND(p_travel_cost < 0.0);
 	ERR_FAIL_COND(p_travel_cost < 0.0);
 
 
 	region->set_travel_cost(p_travel_cost);
 	region->set_travel_cost(p_travel_cost);
@@ -409,28 +409,28 @@ COMMAND_2(region_set_travel_cost, RID, p_region, real_t, p_travel_cost) {
 
 
 real_t GodotNavigationServer::region_get_travel_cost(RID p_region) const {
 real_t GodotNavigationServer::region_get_travel_cost(RID p_region) const {
 	NavRegion *region = region_owner.get_or_null(p_region);
 	NavRegion *region = region_owner.get_or_null(p_region);
-	ERR_FAIL_COND_V(region == nullptr, 0);
+	ERR_FAIL_NULL_V(region, 0);
 
 
 	return region->get_travel_cost();
 	return region->get_travel_cost();
 }
 }
 
 
 COMMAND_2(region_set_owner_id, RID, p_region, ObjectID, p_owner_id) {
 COMMAND_2(region_set_owner_id, RID, p_region, ObjectID, p_owner_id) {
 	NavRegion *region = region_owner.get_or_null(p_region);
 	NavRegion *region = region_owner.get_or_null(p_region);
-	ERR_FAIL_COND(region == nullptr);
+	ERR_FAIL_NULL(region);
 
 
 	region->set_owner_id(p_owner_id);
 	region->set_owner_id(p_owner_id);
 }
 }
 
 
 ObjectID GodotNavigationServer::region_get_owner_id(RID p_region) const {
 ObjectID GodotNavigationServer::region_get_owner_id(RID p_region) const {
 	const NavRegion *region = region_owner.get_or_null(p_region);
 	const NavRegion *region = region_owner.get_or_null(p_region);
-	ERR_FAIL_COND_V(region == nullptr, ObjectID());
+	ERR_FAIL_NULL_V(region, ObjectID());
 
 
 	return region->get_owner_id();
 	return region->get_owner_id();
 }
 }
 
 
 bool GodotNavigationServer::region_owns_point(RID p_region, const Vector3 &p_point) const {
 bool GodotNavigationServer::region_owns_point(RID p_region, const Vector3 &p_point) const {
 	const NavRegion *region = region_owner.get_or_null(p_region);
 	const NavRegion *region = region_owner.get_or_null(p_region);
-	ERR_FAIL_COND_V(region == nullptr, false);
+	ERR_FAIL_NULL_V(region, false);
 
 
 	if (region->get_map()) {
 	if (region->get_map()) {
 		RID closest_point_owner = map_get_closest_point_owner(region->get_map()->get_self(), p_point);
 		RID closest_point_owner = map_get_closest_point_owner(region->get_map()->get_self(), p_point);
@@ -441,21 +441,21 @@ bool GodotNavigationServer::region_owns_point(RID p_region, const Vector3 &p_poi
 
 
 COMMAND_2(region_set_navigation_layers, RID, p_region, uint32_t, p_navigation_layers) {
 COMMAND_2(region_set_navigation_layers, RID, p_region, uint32_t, p_navigation_layers) {
 	NavRegion *region = region_owner.get_or_null(p_region);
 	NavRegion *region = region_owner.get_or_null(p_region);
-	ERR_FAIL_COND(region == nullptr);
+	ERR_FAIL_NULL(region);
 
 
 	region->set_navigation_layers(p_navigation_layers);
 	region->set_navigation_layers(p_navigation_layers);
 }
 }
 
 
 uint32_t GodotNavigationServer::region_get_navigation_layers(RID p_region) const {
 uint32_t GodotNavigationServer::region_get_navigation_layers(RID p_region) const {
 	NavRegion *region = region_owner.get_or_null(p_region);
 	NavRegion *region = region_owner.get_or_null(p_region);
-	ERR_FAIL_COND_V(region == nullptr, 0);
+	ERR_FAIL_NULL_V(region, 0);
 
 
 	return region->get_navigation_layers();
 	return region->get_navigation_layers();
 }
 }
 
 
 COMMAND_2(region_set_navigation_mesh, RID, p_region, Ref<NavigationMesh>, p_navigation_mesh) {
 COMMAND_2(region_set_navigation_mesh, RID, p_region, Ref<NavigationMesh>, p_navigation_mesh) {
 	NavRegion *region = region_owner.get_or_null(p_region);
 	NavRegion *region = region_owner.get_or_null(p_region);
-	ERR_FAIL_COND(region == nullptr);
+	ERR_FAIL_NULL(region);
 
 
 	region->set_mesh(p_navigation_mesh);
 	region->set_mesh(p_navigation_mesh);
 }
 }
@@ -463,7 +463,7 @@ COMMAND_2(region_set_navigation_mesh, RID, p_region, Ref<NavigationMesh>, p_navi
 #ifndef DISABLE_DEPRECATED
 #ifndef DISABLE_DEPRECATED
 void GodotNavigationServer::region_bake_navigation_mesh(Ref<NavigationMesh> p_navigation_mesh, Node *p_root_node) {
 void GodotNavigationServer::region_bake_navigation_mesh(Ref<NavigationMesh> p_navigation_mesh, Node *p_root_node) {
 	ERR_FAIL_COND(p_navigation_mesh.is_null());
 	ERR_FAIL_COND(p_navigation_mesh.is_null());
-	ERR_FAIL_COND(p_root_node == nullptr);
+	ERR_FAIL_NULL(p_root_node);
 
 
 	WARN_PRINT_ONCE("NavigationServer3D::region_bake_navigation_mesh() is deprecated due to core threading changes. To upgrade existing code, first create a NavigationMeshSourceGeometryData3D resource. Use this resource with method parse_source_geometry_data() to parse the SceneTree for nodes that should contribute to the navigation mesh baking. The SceneTree parsing needs to happen on the main thread. After the parsing is finished use the resource with method bake_from_source_geometry_data() to bake a navigation mesh..");
 	WARN_PRINT_ONCE("NavigationServer3D::region_bake_navigation_mesh() is deprecated due to core threading changes. To upgrade existing code, first create a NavigationMeshSourceGeometryData3D resource. Use this resource with method parse_source_geometry_data() to parse the SceneTree for nodes that should contribute to the navigation mesh baking. The SceneTree parsing needs to happen on the main thread. After the parsing is finished use the resource with method bake_from_source_geometry_data() to bake a navigation mesh..");
 
 
@@ -479,21 +479,21 @@ void GodotNavigationServer::region_bake_navigation_mesh(Ref<NavigationMesh> p_na
 
 
 int GodotNavigationServer::region_get_connections_count(RID p_region) const {
 int GodotNavigationServer::region_get_connections_count(RID p_region) const {
 	NavRegion *region = region_owner.get_or_null(p_region);
 	NavRegion *region = region_owner.get_or_null(p_region);
-	ERR_FAIL_COND_V(!region, 0);
+	ERR_FAIL_NULL_V(region, 0);
 
 
 	return region->get_connections_count();
 	return region->get_connections_count();
 }
 }
 
 
 Vector3 GodotNavigationServer::region_get_connection_pathway_start(RID p_region, int p_connection_id) const {
 Vector3 GodotNavigationServer::region_get_connection_pathway_start(RID p_region, int p_connection_id) const {
 	NavRegion *region = region_owner.get_or_null(p_region);
 	NavRegion *region = region_owner.get_or_null(p_region);
-	ERR_FAIL_COND_V(!region, Vector3());
+	ERR_FAIL_NULL_V(region, Vector3());
 
 
 	return region->get_connection_pathway_start(p_connection_id);
 	return region->get_connection_pathway_start(p_connection_id);
 }
 }
 
 
 Vector3 GodotNavigationServer::region_get_connection_pathway_end(RID p_region, int p_connection_id) const {
 Vector3 GodotNavigationServer::region_get_connection_pathway_end(RID p_region, int p_connection_id) const {
 	NavRegion *region = region_owner.get_or_null(p_region);
 	NavRegion *region = region_owner.get_or_null(p_region);
-	ERR_FAIL_COND_V(!region, Vector3());
+	ERR_FAIL_NULL_V(region, Vector3());
 
 
 	return region->get_connection_pathway_end(p_connection_id);
 	return region->get_connection_pathway_end(p_connection_id);
 }
 }
@@ -509,7 +509,7 @@ RID GodotNavigationServer::link_create() {
 
 
 COMMAND_2(link_set_map, RID, p_link, RID, p_map) {
 COMMAND_2(link_set_map, RID, p_link, RID, p_map) {
 	NavLink *link = link_owner.get_or_null(p_link);
 	NavLink *link = link_owner.get_or_null(p_link);
-	ERR_FAIL_COND(link == nullptr);
+	ERR_FAIL_NULL(link);
 
 
 	NavMap *map = map_owner.get_or_null(p_map);
 	NavMap *map = map_owner.get_or_null(p_map);
 
 
@@ -518,7 +518,7 @@ COMMAND_2(link_set_map, RID, p_link, RID, p_map) {
 
 
 RID GodotNavigationServer::link_get_map(const RID p_link) const {
 RID GodotNavigationServer::link_get_map(const RID p_link) const {
 	const NavLink *link = link_owner.get_or_null(p_link);
 	const NavLink *link = link_owner.get_or_null(p_link);
-	ERR_FAIL_COND_V(link == nullptr, RID());
+	ERR_FAIL_NULL_V(link, RID());
 
 
 	if (link->get_map()) {
 	if (link->get_map()) {
 		return link->get_map()->get_self();
 		return link->get_map()->get_self();
@@ -528,112 +528,112 @@ RID GodotNavigationServer::link_get_map(const RID p_link) const {
 
 
 COMMAND_2(link_set_enabled, RID, p_link, bool, p_enabled) {
 COMMAND_2(link_set_enabled, RID, p_link, bool, p_enabled) {
 	NavLink *link = link_owner.get_or_null(p_link);
 	NavLink *link = link_owner.get_or_null(p_link);
-	ERR_FAIL_COND(link == nullptr);
+	ERR_FAIL_NULL(link);
 
 
 	link->set_enabled(p_enabled);
 	link->set_enabled(p_enabled);
 }
 }
 
 
 bool GodotNavigationServer::link_get_enabled(RID p_link) const {
 bool GodotNavigationServer::link_get_enabled(RID p_link) const {
 	const NavLink *link = link_owner.get_or_null(p_link);
 	const NavLink *link = link_owner.get_or_null(p_link);
-	ERR_FAIL_COND_V(link == nullptr, false);
+	ERR_FAIL_NULL_V(link, false);
 
 
 	return link->get_enabled();
 	return link->get_enabled();
 }
 }
 
 
 COMMAND_2(link_set_bidirectional, RID, p_link, bool, p_bidirectional) {
 COMMAND_2(link_set_bidirectional, RID, p_link, bool, p_bidirectional) {
 	NavLink *link = link_owner.get_or_null(p_link);
 	NavLink *link = link_owner.get_or_null(p_link);
-	ERR_FAIL_COND(link == nullptr);
+	ERR_FAIL_NULL(link);
 
 
 	link->set_bidirectional(p_bidirectional);
 	link->set_bidirectional(p_bidirectional);
 }
 }
 
 
 bool GodotNavigationServer::link_is_bidirectional(RID p_link) const {
 bool GodotNavigationServer::link_is_bidirectional(RID p_link) const {
 	const NavLink *link = link_owner.get_or_null(p_link);
 	const NavLink *link = link_owner.get_or_null(p_link);
-	ERR_FAIL_COND_V(link == nullptr, false);
+	ERR_FAIL_NULL_V(link, false);
 
 
 	return link->is_bidirectional();
 	return link->is_bidirectional();
 }
 }
 
 
 COMMAND_2(link_set_navigation_layers, RID, p_link, uint32_t, p_navigation_layers) {
 COMMAND_2(link_set_navigation_layers, RID, p_link, uint32_t, p_navigation_layers) {
 	NavLink *link = link_owner.get_or_null(p_link);
 	NavLink *link = link_owner.get_or_null(p_link);
-	ERR_FAIL_COND(link == nullptr);
+	ERR_FAIL_NULL(link);
 
 
 	link->set_navigation_layers(p_navigation_layers);
 	link->set_navigation_layers(p_navigation_layers);
 }
 }
 
 
 uint32_t GodotNavigationServer::link_get_navigation_layers(const RID p_link) const {
 uint32_t GodotNavigationServer::link_get_navigation_layers(const RID p_link) const {
 	const NavLink *link = link_owner.get_or_null(p_link);
 	const NavLink *link = link_owner.get_or_null(p_link);
-	ERR_FAIL_COND_V(link == nullptr, 0);
+	ERR_FAIL_NULL_V(link, 0);
 
 
 	return link->get_navigation_layers();
 	return link->get_navigation_layers();
 }
 }
 
 
 COMMAND_2(link_set_start_position, RID, p_link, Vector3, p_position) {
 COMMAND_2(link_set_start_position, RID, p_link, Vector3, p_position) {
 	NavLink *link = link_owner.get_or_null(p_link);
 	NavLink *link = link_owner.get_or_null(p_link);
-	ERR_FAIL_COND(link == nullptr);
+	ERR_FAIL_NULL(link);
 
 
 	link->set_start_position(p_position);
 	link->set_start_position(p_position);
 }
 }
 
 
 Vector3 GodotNavigationServer::link_get_start_position(RID p_link) const {
 Vector3 GodotNavigationServer::link_get_start_position(RID p_link) const {
 	const NavLink *link = link_owner.get_or_null(p_link);
 	const NavLink *link = link_owner.get_or_null(p_link);
-	ERR_FAIL_COND_V(link == nullptr, Vector3());
+	ERR_FAIL_NULL_V(link, Vector3());
 
 
 	return link->get_start_position();
 	return link->get_start_position();
 }
 }
 
 
 COMMAND_2(link_set_end_position, RID, p_link, Vector3, p_position) {
 COMMAND_2(link_set_end_position, RID, p_link, Vector3, p_position) {
 	NavLink *link = link_owner.get_or_null(p_link);
 	NavLink *link = link_owner.get_or_null(p_link);
-	ERR_FAIL_COND(link == nullptr);
+	ERR_FAIL_NULL(link);
 
 
 	link->set_end_position(p_position);
 	link->set_end_position(p_position);
 }
 }
 
 
 Vector3 GodotNavigationServer::link_get_end_position(RID p_link) const {
 Vector3 GodotNavigationServer::link_get_end_position(RID p_link) const {
 	const NavLink *link = link_owner.get_or_null(p_link);
 	const NavLink *link = link_owner.get_or_null(p_link);
-	ERR_FAIL_COND_V(link == nullptr, Vector3());
+	ERR_FAIL_NULL_V(link, Vector3());
 
 
 	return link->get_end_position();
 	return link->get_end_position();
 }
 }
 
 
 COMMAND_2(link_set_enter_cost, RID, p_link, real_t, p_enter_cost) {
 COMMAND_2(link_set_enter_cost, RID, p_link, real_t, p_enter_cost) {
 	NavLink *link = link_owner.get_or_null(p_link);
 	NavLink *link = link_owner.get_or_null(p_link);
-	ERR_FAIL_COND(link == nullptr);
+	ERR_FAIL_NULL(link);
 
 
 	link->set_enter_cost(p_enter_cost);
 	link->set_enter_cost(p_enter_cost);
 }
 }
 
 
 real_t GodotNavigationServer::link_get_enter_cost(const RID p_link) const {
 real_t GodotNavigationServer::link_get_enter_cost(const RID p_link) const {
 	const NavLink *link = link_owner.get_or_null(p_link);
 	const NavLink *link = link_owner.get_or_null(p_link);
-	ERR_FAIL_COND_V(link == nullptr, 0);
+	ERR_FAIL_NULL_V(link, 0);
 
 
 	return link->get_enter_cost();
 	return link->get_enter_cost();
 }
 }
 
 
 COMMAND_2(link_set_travel_cost, RID, p_link, real_t, p_travel_cost) {
 COMMAND_2(link_set_travel_cost, RID, p_link, real_t, p_travel_cost) {
 	NavLink *link = link_owner.get_or_null(p_link);
 	NavLink *link = link_owner.get_or_null(p_link);
-	ERR_FAIL_COND(link == nullptr);
+	ERR_FAIL_NULL(link);
 
 
 	link->set_travel_cost(p_travel_cost);
 	link->set_travel_cost(p_travel_cost);
 }
 }
 
 
 real_t GodotNavigationServer::link_get_travel_cost(const RID p_link) const {
 real_t GodotNavigationServer::link_get_travel_cost(const RID p_link) const {
 	const NavLink *link = link_owner.get_or_null(p_link);
 	const NavLink *link = link_owner.get_or_null(p_link);
-	ERR_FAIL_COND_V(link == nullptr, 0);
+	ERR_FAIL_NULL_V(link, 0);
 
 
 	return link->get_travel_cost();
 	return link->get_travel_cost();
 }
 }
 
 
 COMMAND_2(link_set_owner_id, RID, p_link, ObjectID, p_owner_id) {
 COMMAND_2(link_set_owner_id, RID, p_link, ObjectID, p_owner_id) {
 	NavLink *link = link_owner.get_or_null(p_link);
 	NavLink *link = link_owner.get_or_null(p_link);
-	ERR_FAIL_COND(link == nullptr);
+	ERR_FAIL_NULL(link);
 
 
 	link->set_owner_id(p_owner_id);
 	link->set_owner_id(p_owner_id);
 }
 }
 
 
 ObjectID GodotNavigationServer::link_get_owner_id(RID p_link) const {
 ObjectID GodotNavigationServer::link_get_owner_id(RID p_link) const {
 	const NavLink *link = link_owner.get_or_null(p_link);
 	const NavLink *link = link_owner.get_or_null(p_link);
-	ERR_FAIL_COND_V(link == nullptr, ObjectID());
+	ERR_FAIL_NULL_V(link, ObjectID());
 
 
 	return link->get_owner_id();
 	return link->get_owner_id();
 }
 }
@@ -649,35 +649,35 @@ RID GodotNavigationServer::agent_create() {
 
 
 COMMAND_2(agent_set_avoidance_enabled, RID, p_agent, bool, p_enabled) {
 COMMAND_2(agent_set_avoidance_enabled, RID, p_agent, bool, p_enabled) {
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND(agent == nullptr);
+	ERR_FAIL_NULL(agent);
 
 
 	agent->set_avoidance_enabled(p_enabled);
 	agent->set_avoidance_enabled(p_enabled);
 }
 }
 
 
 bool GodotNavigationServer::agent_get_avoidance_enabled(RID p_agent) const {
 bool GodotNavigationServer::agent_get_avoidance_enabled(RID p_agent) const {
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND_V(agent == nullptr, false);
+	ERR_FAIL_NULL_V(agent, false);
 
 
 	return agent->is_avoidance_enabled();
 	return agent->is_avoidance_enabled();
 }
 }
 
 
 COMMAND_2(agent_set_use_3d_avoidance, RID, p_agent, bool, p_enabled) {
 COMMAND_2(agent_set_use_3d_avoidance, RID, p_agent, bool, p_enabled) {
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND(agent == nullptr);
+	ERR_FAIL_NULL(agent);
 
 
 	agent->set_use_3d_avoidance(p_enabled);
 	agent->set_use_3d_avoidance(p_enabled);
 }
 }
 
 
 bool GodotNavigationServer::agent_get_use_3d_avoidance(RID p_agent) const {
 bool GodotNavigationServer::agent_get_use_3d_avoidance(RID p_agent) const {
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND_V(agent == nullptr, false);
+	ERR_FAIL_NULL_V(agent, false);
 
 
 	return agent->get_use_3d_avoidance();
 	return agent->get_use_3d_avoidance();
 }
 }
 
 
 COMMAND_2(agent_set_map, RID, p_agent, RID, p_map) {
 COMMAND_2(agent_set_map, RID, p_agent, RID, p_map) {
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND(agent == nullptr);
+	ERR_FAIL_NULL(agent);
 
 
 	NavMap *map = map_owner.get_or_null(p_map);
 	NavMap *map = map_owner.get_or_null(p_map);
 
 
@@ -686,28 +686,28 @@ COMMAND_2(agent_set_map, RID, p_agent, RID, p_map) {
 
 
 COMMAND_2(agent_set_paused, RID, p_agent, bool, p_paused) {
 COMMAND_2(agent_set_paused, RID, p_agent, bool, p_paused) {
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND(agent == nullptr);
+	ERR_FAIL_NULL(agent);
 
 
 	agent->set_paused(p_paused);
 	agent->set_paused(p_paused);
 }
 }
 
 
 bool GodotNavigationServer::agent_get_paused(RID p_agent) const {
 bool GodotNavigationServer::agent_get_paused(RID p_agent) const {
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND_V(agent == nullptr, false);
+	ERR_FAIL_NULL_V(agent, false);
 
 
 	return agent->get_paused();
 	return agent->get_paused();
 }
 }
 
 
 COMMAND_2(agent_set_neighbor_distance, RID, p_agent, real_t, p_distance) {
 COMMAND_2(agent_set_neighbor_distance, RID, p_agent, real_t, p_distance) {
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND(agent == nullptr);
+	ERR_FAIL_NULL(agent);
 
 
 	agent->set_neighbor_distance(p_distance);
 	agent->set_neighbor_distance(p_distance);
 }
 }
 
 
 COMMAND_2(agent_set_max_neighbors, RID, p_agent, int, p_count) {
 COMMAND_2(agent_set_max_neighbors, RID, p_agent, int, p_count) {
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND(agent == nullptr);
+	ERR_FAIL_NULL(agent);
 
 
 	agent->set_max_neighbors(p_count);
 	agent->set_max_neighbors(p_count);
 }
 }
@@ -715,7 +715,7 @@ COMMAND_2(agent_set_max_neighbors, RID, p_agent, int, p_count) {
 COMMAND_2(agent_set_time_horizon_agents, RID, p_agent, real_t, p_time_horizon) {
 COMMAND_2(agent_set_time_horizon_agents, RID, p_agent, real_t, p_time_horizon) {
 	ERR_FAIL_COND_MSG(p_time_horizon < 0.0, "Time horizion must be positive.");
 	ERR_FAIL_COND_MSG(p_time_horizon < 0.0, "Time horizion must be positive.");
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND(agent == nullptr);
+	ERR_FAIL_NULL(agent);
 
 
 	agent->set_time_horizon_agents(p_time_horizon);
 	agent->set_time_horizon_agents(p_time_horizon);
 }
 }
@@ -723,7 +723,7 @@ COMMAND_2(agent_set_time_horizon_agents, RID, p_agent, real_t, p_time_horizon) {
 COMMAND_2(agent_set_time_horizon_obstacles, RID, p_agent, real_t, p_time_horizon) {
 COMMAND_2(agent_set_time_horizon_obstacles, RID, p_agent, real_t, p_time_horizon) {
 	ERR_FAIL_COND_MSG(p_time_horizon < 0.0, "Time horizion must be positive.");
 	ERR_FAIL_COND_MSG(p_time_horizon < 0.0, "Time horizion must be positive.");
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND(agent == nullptr);
+	ERR_FAIL_NULL(agent);
 
 
 	agent->set_time_horizon_obstacles(p_time_horizon);
 	agent->set_time_horizon_obstacles(p_time_horizon);
 }
 }
@@ -731,7 +731,7 @@ COMMAND_2(agent_set_time_horizon_obstacles, RID, p_agent, real_t, p_time_horizon
 COMMAND_2(agent_set_radius, RID, p_agent, real_t, p_radius) {
 COMMAND_2(agent_set_radius, RID, p_agent, real_t, p_radius) {
 	ERR_FAIL_COND_MSG(p_radius < 0.0, "Radius must be positive.");
 	ERR_FAIL_COND_MSG(p_radius < 0.0, "Radius must be positive.");
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND(agent == nullptr);
+	ERR_FAIL_NULL(agent);
 
 
 	agent->set_radius(p_radius);
 	agent->set_radius(p_radius);
 }
 }
@@ -739,7 +739,7 @@ COMMAND_2(agent_set_radius, RID, p_agent, real_t, p_radius) {
 COMMAND_2(agent_set_height, RID, p_agent, real_t, p_height) {
 COMMAND_2(agent_set_height, RID, p_agent, real_t, p_height) {
 	ERR_FAIL_COND_MSG(p_height < 0.0, "Height must be positive.");
 	ERR_FAIL_COND_MSG(p_height < 0.0, "Height must be positive.");
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND(agent == nullptr);
+	ERR_FAIL_NULL(agent);
 
 
 	agent->set_height(p_height);
 	agent->set_height(p_height);
 }
 }
@@ -747,42 +747,42 @@ COMMAND_2(agent_set_height, RID, p_agent, real_t, p_height) {
 COMMAND_2(agent_set_max_speed, RID, p_agent, real_t, p_max_speed) {
 COMMAND_2(agent_set_max_speed, RID, p_agent, real_t, p_max_speed) {
 	ERR_FAIL_COND_MSG(p_max_speed < 0.0, "Max speed must be positive.");
 	ERR_FAIL_COND_MSG(p_max_speed < 0.0, "Max speed must be positive.");
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND(agent == nullptr);
+	ERR_FAIL_NULL(agent);
 
 
 	agent->set_max_speed(p_max_speed);
 	agent->set_max_speed(p_max_speed);
 }
 }
 
 
 COMMAND_2(agent_set_velocity, RID, p_agent, Vector3, p_velocity) {
 COMMAND_2(agent_set_velocity, RID, p_agent, Vector3, p_velocity) {
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND(agent == nullptr);
+	ERR_FAIL_NULL(agent);
 
 
 	agent->set_velocity(p_velocity);
 	agent->set_velocity(p_velocity);
 }
 }
 
 
 COMMAND_2(agent_set_velocity_forced, RID, p_agent, Vector3, p_velocity) {
 COMMAND_2(agent_set_velocity_forced, RID, p_agent, Vector3, p_velocity) {
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND(agent == nullptr);
+	ERR_FAIL_NULL(agent);
 
 
 	agent->set_velocity_forced(p_velocity);
 	agent->set_velocity_forced(p_velocity);
 }
 }
 
 
 COMMAND_2(agent_set_position, RID, p_agent, Vector3, p_position) {
 COMMAND_2(agent_set_position, RID, p_agent, Vector3, p_position) {
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND(agent == nullptr);
+	ERR_FAIL_NULL(agent);
 
 
 	agent->set_position(p_position);
 	agent->set_position(p_position);
 }
 }
 
 
 bool GodotNavigationServer::agent_is_map_changed(RID p_agent) const {
 bool GodotNavigationServer::agent_is_map_changed(RID p_agent) const {
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND_V(agent == nullptr, false);
+	ERR_FAIL_NULL_V(agent, false);
 
 
 	return agent->is_map_changed();
 	return agent->is_map_changed();
 }
 }
 
 
 COMMAND_2(agent_set_avoidance_callback, RID, p_agent, Callable, p_callback) {
 COMMAND_2(agent_set_avoidance_callback, RID, p_agent, Callable, p_callback) {
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND(agent == nullptr);
+	ERR_FAIL_NULL(agent);
 
 
 	agent->set_avoidance_callback(p_callback);
 	agent->set_avoidance_callback(p_callback);
 
 
@@ -797,13 +797,13 @@ COMMAND_2(agent_set_avoidance_callback, RID, p_agent, Callable, p_callback) {
 
 
 COMMAND_2(agent_set_avoidance_layers, RID, p_agent, uint32_t, p_layers) {
 COMMAND_2(agent_set_avoidance_layers, RID, p_agent, uint32_t, p_layers) {
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND(agent == nullptr);
+	ERR_FAIL_NULL(agent);
 	agent->set_avoidance_layers(p_layers);
 	agent->set_avoidance_layers(p_layers);
 }
 }
 
 
 COMMAND_2(agent_set_avoidance_mask, RID, p_agent, uint32_t, p_mask) {
 COMMAND_2(agent_set_avoidance_mask, RID, p_agent, uint32_t, p_mask) {
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND(agent == nullptr);
+	ERR_FAIL_NULL(agent);
 	agent->set_avoidance_mask(p_mask);
 	agent->set_avoidance_mask(p_mask);
 }
 }
 
 
@@ -811,7 +811,7 @@ COMMAND_2(agent_set_avoidance_priority, RID, p_agent, real_t, p_priority) {
 	ERR_FAIL_COND_MSG(p_priority < 0.0, "Avoidance priority must be between 0.0 and 1.0 inclusive.");
 	ERR_FAIL_COND_MSG(p_priority < 0.0, "Avoidance priority must be between 0.0 and 1.0 inclusive.");
 	ERR_FAIL_COND_MSG(p_priority > 1.0, "Avoidance priority must be between 0.0 and 1.0 inclusive.");
 	ERR_FAIL_COND_MSG(p_priority > 1.0, "Avoidance priority must be between 0.0 and 1.0 inclusive.");
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
 	NavAgent *agent = agent_owner.get_or_null(p_agent);
-	ERR_FAIL_COND(agent == nullptr);
+	ERR_FAIL_NULL(agent);
 	agent->set_avoidance_priority(p_priority);
 	agent->set_avoidance_priority(p_priority);
 }
 }
 
 
@@ -833,35 +833,35 @@ RID GodotNavigationServer::obstacle_create() {
 
 
 COMMAND_2(obstacle_set_avoidance_enabled, RID, p_obstacle, bool, p_enabled) {
 COMMAND_2(obstacle_set_avoidance_enabled, RID, p_obstacle, bool, p_enabled) {
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
-	ERR_FAIL_COND(obstacle == nullptr);
+	ERR_FAIL_NULL(obstacle);
 
 
 	obstacle->set_avoidance_enabled(p_enabled);
 	obstacle->set_avoidance_enabled(p_enabled);
 }
 }
 
 
 bool GodotNavigationServer::obstacle_get_avoidance_enabled(RID p_obstacle) const {
 bool GodotNavigationServer::obstacle_get_avoidance_enabled(RID p_obstacle) const {
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
-	ERR_FAIL_COND_V(obstacle == nullptr, false);
+	ERR_FAIL_NULL_V(obstacle, false);
 
 
 	return obstacle->is_avoidance_enabled();
 	return obstacle->is_avoidance_enabled();
 }
 }
 
 
 COMMAND_2(obstacle_set_use_3d_avoidance, RID, p_obstacle, bool, p_enabled) {
 COMMAND_2(obstacle_set_use_3d_avoidance, RID, p_obstacle, bool, p_enabled) {
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
-	ERR_FAIL_COND(obstacle == nullptr);
+	ERR_FAIL_NULL(obstacle);
 
 
 	obstacle->set_use_3d_avoidance(p_enabled);
 	obstacle->set_use_3d_avoidance(p_enabled);
 }
 }
 
 
 bool GodotNavigationServer::obstacle_get_use_3d_avoidance(RID p_obstacle) const {
 bool GodotNavigationServer::obstacle_get_use_3d_avoidance(RID p_obstacle) const {
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
-	ERR_FAIL_COND_V(obstacle == nullptr, false);
+	ERR_FAIL_NULL_V(obstacle, false);
 
 
 	return obstacle->get_use_3d_avoidance();
 	return obstacle->get_use_3d_avoidance();
 }
 }
 
 
 COMMAND_2(obstacle_set_map, RID, p_obstacle, RID, p_map) {
 COMMAND_2(obstacle_set_map, RID, p_obstacle, RID, p_map) {
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
-	ERR_FAIL_COND(obstacle == nullptr);
+	ERR_FAIL_NULL(obstacle);
 
 
 	NavMap *map = map_owner.get_or_null(p_map);
 	NavMap *map = map_owner.get_or_null(p_map);
 
 
@@ -870,7 +870,7 @@ COMMAND_2(obstacle_set_map, RID, p_obstacle, RID, p_map) {
 
 
 RID GodotNavigationServer::obstacle_get_map(RID p_obstacle) const {
 RID GodotNavigationServer::obstacle_get_map(RID p_obstacle) const {
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
-	ERR_FAIL_COND_V(obstacle == nullptr, RID());
+	ERR_FAIL_NULL_V(obstacle, RID());
 	if (obstacle->get_map()) {
 	if (obstacle->get_map()) {
 		return obstacle->get_map()->get_self();
 		return obstacle->get_map()->get_self();
 	}
 	}
@@ -879,14 +879,14 @@ RID GodotNavigationServer::obstacle_get_map(RID p_obstacle) const {
 
 
 COMMAND_2(obstacle_set_paused, RID, p_obstacle, bool, p_paused) {
 COMMAND_2(obstacle_set_paused, RID, p_obstacle, bool, p_paused) {
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
-	ERR_FAIL_COND(obstacle == nullptr);
+	ERR_FAIL_NULL(obstacle);
 
 
 	obstacle->set_paused(p_paused);
 	obstacle->set_paused(p_paused);
 }
 }
 
 
 bool GodotNavigationServer::obstacle_get_paused(RID p_obstacle) const {
 bool GodotNavigationServer::obstacle_get_paused(RID p_obstacle) const {
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
-	ERR_FAIL_COND_V(obstacle == nullptr, false);
+	ERR_FAIL_NULL_V(obstacle, false);
 
 
 	return obstacle->get_paused();
 	return obstacle->get_paused();
 }
 }
@@ -894,39 +894,39 @@ bool GodotNavigationServer::obstacle_get_paused(RID p_obstacle) const {
 COMMAND_2(obstacle_set_radius, RID, p_obstacle, real_t, p_radius) {
 COMMAND_2(obstacle_set_radius, RID, p_obstacle, real_t, p_radius) {
 	ERR_FAIL_COND_MSG(p_radius < 0.0, "Radius must be positive.");
 	ERR_FAIL_COND_MSG(p_radius < 0.0, "Radius must be positive.");
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
-	ERR_FAIL_COND(obstacle == nullptr);
+	ERR_FAIL_NULL(obstacle);
 
 
 	obstacle->set_radius(p_radius);
 	obstacle->set_radius(p_radius);
 }
 }
 
 
 COMMAND_2(obstacle_set_height, RID, p_obstacle, real_t, p_height) {
 COMMAND_2(obstacle_set_height, RID, p_obstacle, real_t, p_height) {
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
-	ERR_FAIL_COND(obstacle == nullptr);
+	ERR_FAIL_NULL(obstacle);
 	obstacle->set_height(p_height);
 	obstacle->set_height(p_height);
 }
 }
 
 
 COMMAND_2(obstacle_set_velocity, RID, p_obstacle, Vector3, p_velocity) {
 COMMAND_2(obstacle_set_velocity, RID, p_obstacle, Vector3, p_velocity) {
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
-	ERR_FAIL_COND(obstacle == nullptr);
+	ERR_FAIL_NULL(obstacle);
 
 
 	obstacle->set_velocity(p_velocity);
 	obstacle->set_velocity(p_velocity);
 }
 }
 
 
 COMMAND_2(obstacle_set_position, RID, p_obstacle, Vector3, p_position) {
 COMMAND_2(obstacle_set_position, RID, p_obstacle, Vector3, p_position) {
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
-	ERR_FAIL_COND(obstacle == nullptr);
+	ERR_FAIL_NULL(obstacle);
 	obstacle->set_position(p_position);
 	obstacle->set_position(p_position);
 }
 }
 
 
 void GodotNavigationServer::obstacle_set_vertices(RID p_obstacle, const Vector<Vector3> &p_vertices) {
 void GodotNavigationServer::obstacle_set_vertices(RID p_obstacle, const Vector<Vector3> &p_vertices) {
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
-	ERR_FAIL_COND(obstacle == nullptr);
+	ERR_FAIL_NULL(obstacle);
 	obstacle->set_vertices(p_vertices);
 	obstacle->set_vertices(p_vertices);
 }
 }
 
 
 COMMAND_2(obstacle_set_avoidance_layers, RID, p_obstacle, uint32_t, p_layers) {
 COMMAND_2(obstacle_set_avoidance_layers, RID, p_obstacle, uint32_t, p_layers) {
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
 	NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
-	ERR_FAIL_COND(obstacle == nullptr);
+	ERR_FAIL_NULL(obstacle);
 	obstacle->set_avoidance_layers(p_layers);
 	obstacle->set_avoidance_layers(p_layers);
 }
 }
 
 
@@ -934,7 +934,7 @@ void GodotNavigationServer::parse_source_geometry_data(const Ref<NavigationMesh>
 #ifndef _3D_DISABLED
 #ifndef _3D_DISABLED
 	ERR_FAIL_COND_MSG(!Thread::is_main_thread(), "The SceneTree can only be parsed on the main thread. Call this function from the main thread or use call_deferred().");
 	ERR_FAIL_COND_MSG(!Thread::is_main_thread(), "The SceneTree can only be parsed on the main thread. Call this function from the main thread or use call_deferred().");
 	ERR_FAIL_COND_MSG(!p_navigation_mesh.is_valid(), "Invalid navigation mesh.");
 	ERR_FAIL_COND_MSG(!p_navigation_mesh.is_valid(), "Invalid navigation mesh.");
-	ERR_FAIL_COND_MSG(p_root_node == nullptr, "No parsing root node specified.");
+	ERR_FAIL_NULL_MSG(p_root_node, "No parsing root node specified.");
 	ERR_FAIL_COND_MSG(!p_root_node->is_inside_tree(), "The root node needs to be inside the SceneTree.");
 	ERR_FAIL_COND_MSG(!p_root_node->is_inside_tree(), "The root node needs to be inside the SceneTree.");
 
 
 	ERR_FAIL_NULL(NavMeshGenerator3D::get_singleton());
 	ERR_FAIL_NULL(NavMeshGenerator3D::get_singleton());
@@ -1079,7 +1079,7 @@ void GodotNavigationServer::flush_queries() {
 
 
 void GodotNavigationServer::map_force_update(RID p_map) {
 void GodotNavigationServer::map_force_update(RID p_map) {
 	NavMap *map = map_owner.get_or_null(p_map);
 	NavMap *map = map_owner.get_or_null(p_map);
-	ERR_FAIL_COND(map == nullptr);
+	ERR_FAIL_NULL(map);
 
 
 	flush_queries();
 	flush_queries();
 
 
@@ -1166,7 +1166,7 @@ PathQueryResult GodotNavigationServer::_query_path(const PathQueryParameters &p_
 	PathQueryResult r_query_result;
 	PathQueryResult r_query_result;
 
 
 	const NavMap *map = map_owner.get_or_null(p_parameters.map);
 	const NavMap *map = map_owner.get_or_null(p_parameters.map);
-	ERR_FAIL_COND_V(map == nullptr, r_query_result);
+	ERR_FAIL_NULL_V(map, r_query_result);
 
 
 	// run the pathfinding
 	// run the pathfinding
 
 

+ 6 - 6
modules/navigation/nav_mesh_generator_3d.cpp

@@ -149,7 +149,7 @@ void NavMeshGenerator3D::finish() {
 void NavMeshGenerator3D::parse_source_geometry_data(Ref<NavigationMesh> p_navigation_mesh, Ref<NavigationMeshSourceGeometryData3D> p_source_geometry_data, Node *p_root_node, const Callable &p_callback) {
 void NavMeshGenerator3D::parse_source_geometry_data(Ref<NavigationMesh> p_navigation_mesh, Ref<NavigationMeshSourceGeometryData3D> p_source_geometry_data, Node *p_root_node, const Callable &p_callback) {
 	ERR_FAIL_COND(!Thread::is_main_thread());
 	ERR_FAIL_COND(!Thread::is_main_thread());
 	ERR_FAIL_COND(!p_navigation_mesh.is_valid());
 	ERR_FAIL_COND(!p_navigation_mesh.is_valid());
-	ERR_FAIL_COND(p_root_node == nullptr);
+	ERR_FAIL_NULL(p_root_node);
 	ERR_FAIL_COND(!p_root_node->is_inside_tree());
 	ERR_FAIL_COND(!p_root_node->is_inside_tree());
 	ERR_FAIL_COND(!p_source_geometry_data.is_valid());
 	ERR_FAIL_COND(!p_source_geometry_data.is_valid());
 
 
@@ -714,7 +714,7 @@ void NavMeshGenerator3D::generator_bake_from_source_geometry_data(Ref<Navigation
 	bake_state = "Creating heightfield..."; // step #3
 	bake_state = "Creating heightfield..."; // step #3
 	hf = rcAllocHeightfield();
 	hf = rcAllocHeightfield();
 
 
-	ERR_FAIL_COND(!hf);
+	ERR_FAIL_NULL(hf);
 	ERR_FAIL_COND(!rcCreateHeightfield(&ctx, *hf, cfg.width, cfg.height, cfg.bmin, cfg.bmax, cfg.cs, cfg.ch));
 	ERR_FAIL_COND(!rcCreateHeightfield(&ctx, *hf, cfg.width, cfg.height, cfg.bmin, cfg.bmax, cfg.cs, cfg.ch));
 
 
 	bake_state = "Marking walkable triangles..."; // step #4
 	bake_state = "Marking walkable triangles..."; // step #4
@@ -744,7 +744,7 @@ void NavMeshGenerator3D::generator_bake_from_source_geometry_data(Ref<Navigation
 
 
 	chf = rcAllocCompactHeightfield();
 	chf = rcAllocCompactHeightfield();
 
 
-	ERR_FAIL_COND(!chf);
+	ERR_FAIL_NULL(chf);
 	ERR_FAIL_COND(!rcBuildCompactHeightfield(&ctx, cfg.walkableHeight, cfg.walkableClimb, *hf, *chf));
 	ERR_FAIL_COND(!rcBuildCompactHeightfield(&ctx, cfg.walkableHeight, cfg.walkableClimb, *hf, *chf));
 
 
 	rcFreeHeightField(hf);
 	rcFreeHeightField(hf);
@@ -769,17 +769,17 @@ void NavMeshGenerator3D::generator_bake_from_source_geometry_data(Ref<Navigation
 
 
 	cset = rcAllocContourSet();
 	cset = rcAllocContourSet();
 
 
-	ERR_FAIL_COND(!cset);
+	ERR_FAIL_NULL(cset);
 	ERR_FAIL_COND(!rcBuildContours(&ctx, *chf, cfg.maxSimplificationError, cfg.maxEdgeLen, *cset));
 	ERR_FAIL_COND(!rcBuildContours(&ctx, *chf, cfg.maxSimplificationError, cfg.maxEdgeLen, *cset));
 
 
 	bake_state = "Creating polymesh..."; // step #9
 	bake_state = "Creating polymesh..."; // step #9
 
 
 	poly_mesh = rcAllocPolyMesh();
 	poly_mesh = rcAllocPolyMesh();
-	ERR_FAIL_COND(!poly_mesh);
+	ERR_FAIL_NULL(poly_mesh);
 	ERR_FAIL_COND(!rcBuildPolyMesh(&ctx, *cset, cfg.maxVertsPerPoly, *poly_mesh));
 	ERR_FAIL_COND(!rcBuildPolyMesh(&ctx, *cset, cfg.maxVertsPerPoly, *poly_mesh));
 
 
 	detail_mesh = rcAllocPolyMeshDetail();
 	detail_mesh = rcAllocPolyMeshDetail();
-	ERR_FAIL_COND(!detail_mesh);
+	ERR_FAIL_NULL(detail_mesh);
 	ERR_FAIL_COND(!rcBuildPolyMeshDetail(&ctx, *poly_mesh, *chf, cfg.detailSampleDist, cfg.detailSampleMaxError, *detail_mesh));
 	ERR_FAIL_COND(!rcBuildPolyMeshDetail(&ctx, *poly_mesh, *chf, cfg.detailSampleDist, cfg.detailSampleMaxError, *detail_mesh));
 
 
 	rcFreeCompactHeightfield(chf);
 	rcFreeCompactHeightfield(chf);

+ 2 - 2
modules/navigation/nav_region.cpp

@@ -89,13 +89,13 @@ int NavRegion::get_connections_count() const {
 }
 }
 
 
 Vector3 NavRegion::get_connection_pathway_start(int p_connection_id) const {
 Vector3 NavRegion::get_connection_pathway_start(int p_connection_id) const {
-	ERR_FAIL_COND_V(!map, Vector3());
+	ERR_FAIL_NULL_V(map, Vector3());
 	ERR_FAIL_INDEX_V(p_connection_id, connections.size(), Vector3());
 	ERR_FAIL_INDEX_V(p_connection_id, connections.size(), Vector3());
 	return connections[p_connection_id].pathway_start;
 	return connections[p_connection_id].pathway_start;
 }
 }
 
 
 Vector3 NavRegion::get_connection_pathway_end(int p_connection_id) const {
 Vector3 NavRegion::get_connection_pathway_end(int p_connection_id) const {
-	ERR_FAIL_COND_V(!map, Vector3());
+	ERR_FAIL_NULL_V(map, Vector3());
 	ERR_FAIL_INDEX_V(p_connection_id, connections.size(), Vector3());
 	ERR_FAIL_INDEX_V(p_connection_id, connections.size(), Vector3());
 	return connections[p_connection_id].pathway_end;
 	return connections[p_connection_id].pathway_end;
 }
 }

+ 5 - 5
modules/raycast/raycast_occlusion_cull.cpp

@@ -221,7 +221,7 @@ void RaycastOcclusionCull::occluder_initialize(RID p_occluder) {
 
 
 void RaycastOcclusionCull::occluder_set_mesh(RID p_occluder, const PackedVector3Array &p_vertices, const PackedInt32Array &p_indices) {
 void RaycastOcclusionCull::occluder_set_mesh(RID p_occluder, const PackedVector3Array &p_vertices, const PackedInt32Array &p_indices) {
 	Occluder *occluder = occluder_owner.get_or_null(p_occluder);
 	Occluder *occluder = occluder_owner.get_or_null(p_occluder);
-	ERR_FAIL_COND(!occluder);
+	ERR_FAIL_NULL(occluder);
 
 
 	occluder->vertices = p_vertices;
 	occluder->vertices = p_vertices;
 	occluder->indices = p_indices;
 	occluder->indices = p_indices;
@@ -242,7 +242,7 @@ void RaycastOcclusionCull::occluder_set_mesh(RID p_occluder, const PackedVector3
 
 
 void RaycastOcclusionCull::free_occluder(RID p_occluder) {
 void RaycastOcclusionCull::free_occluder(RID p_occluder) {
 	Occluder *occluder = occluder_owner.get_or_null(p_occluder);
 	Occluder *occluder = occluder_owner.get_or_null(p_occluder);
-	ERR_FAIL_COND(!occluder);
+	ERR_FAIL_NULL(occluder);
 	memdelete(occluder);
 	memdelete(occluder);
 	occluder_owner.free(p_occluder);
 	occluder_owner.free(p_occluder);
 }
 }
@@ -291,7 +291,7 @@ void RaycastOcclusionCull::scenario_set_instance(RID p_scenario, RID p_instance,
 
 
 		if (p_occluder.is_valid()) {
 		if (p_occluder.is_valid()) {
 			Occluder *occluder = occluder_owner.get_or_null(p_occluder);
 			Occluder *occluder = occluder_owner.get_or_null(p_occluder);
-			ERR_FAIL_COND(!occluder);
+			ERR_FAIL_NULL(occluder);
 			occluder->users.insert(InstanceID(p_scenario, p_instance));
 			occluder->users.insert(InstanceID(p_scenario, p_instance));
 		}
 		}
 		changed = true;
 		changed = true;
@@ -398,7 +398,7 @@ void RaycastOcclusionCull::Scenario::_commit_scene(void *p_ud) {
 }
 }
 
 
 bool RaycastOcclusionCull::Scenario::update() {
 bool RaycastOcclusionCull::Scenario::update() {
-	ERR_FAIL_COND_V(singleton == nullptr, false);
+	ERR_FAIL_NULL_V(singleton, false);
 
 
 	if (commit_thread == nullptr) {
 	if (commit_thread == nullptr) {
 		commit_thread = memnew(Thread);
 		commit_thread = memnew(Thread);
@@ -492,7 +492,7 @@ void RaycastOcclusionCull::Scenario::_raycast(uint32_t p_idx, const RaycastThrea
 }
 }
 
 
 void RaycastOcclusionCull::Scenario::raycast(CameraRayTile *r_rays, const uint32_t *p_valid_masks, uint32_t p_tile_count) const {
 void RaycastOcclusionCull::Scenario::raycast(CameraRayTile *r_rays, const uint32_t *p_valid_masks, uint32_t p_tile_count) const {
-	ERR_FAIL_COND(singleton == nullptr);
+	ERR_FAIL_NULL(singleton);
 	if (raycast_singleton->ebr_device == nullptr) {
 	if (raycast_singleton->ebr_device == nullptr) {
 		return; // Embree is initialized on demand when there is some scenario with occluders in it.
 		return; // Embree is initialized on demand when there is some scenario with occluders in it.
 	}
 	}

Разница между файлами не показана из-за своего большого размера
+ 112 - 112
modules/text_server_adv/text_server_adv.cpp


Разница между файлами не показана из-за своего большого размера
+ 112 - 112
modules/text_server_fb/text_server_fb.cpp


+ 2 - 2
modules/upnp/upnp.cpp

@@ -242,14 +242,14 @@ Ref<UPNPDevice> UPNP::get_device(int index) const {
 }
 }
 
 
 void UPNP::add_device(Ref<UPNPDevice> device) {
 void UPNP::add_device(Ref<UPNPDevice> device) {
-	ERR_FAIL_COND(device == nullptr);
+	ERR_FAIL_NULL(device);
 
 
 	devices.push_back(device);
 	devices.push_back(device);
 }
 }
 
 
 void UPNP::set_device(int index, Ref<UPNPDevice> device) {
 void UPNP::set_device(int index, Ref<UPNPDevice> device) {
 	ERR_FAIL_INDEX(index, devices.size());
 	ERR_FAIL_INDEX(index, devices.size());
-	ERR_FAIL_COND(device == nullptr);
+	ERR_FAIL_NULL(device);
 
 
 	devices.set(index, device);
 	devices.set(index, device);
 }
 }

+ 2 - 2
modules/websocket/wsl_peer.cpp

@@ -600,7 +600,7 @@ ssize_t WSLPeer::_wsl_send_callback(wslay_event_context_ptr ctx, const uint8_t *
 }
 }
 
 
 int WSLPeer::_wsl_genmask_callback(wslay_event_context_ptr ctx, uint8_t *buf, size_t len, void *user_data) {
 int WSLPeer::_wsl_genmask_callback(wslay_event_context_ptr ctx, uint8_t *buf, size_t len, void *user_data) {
-	ERR_FAIL_COND_V(!_static_rng, WSLAY_ERR_CALLBACK_FAILURE);
+	ERR_FAIL_NULL_V(_static_rng, WSLAY_ERR_CALLBACK_FAILURE);
 	Error err = _static_rng->get_random_bytes(buf, len);
 	Error err = _static_rng->get_random_bytes(buf, len);
 	ERR_FAIL_COND_V(err != OK, WSLAY_ERR_CALLBACK_FAILURE);
 	ERR_FAIL_COND_V(err != OK, WSLAY_ERR_CALLBACK_FAILURE);
 	return 0;
 	return 0;
@@ -676,7 +676,7 @@ void WSLPeer::poll() {
 	}
 	}
 
 
 	if (ready_state == STATE_OPEN || ready_state == STATE_CLOSING) {
 	if (ready_state == STATE_OPEN || ready_state == STATE_CLOSING) {
-		ERR_FAIL_COND(!wsl_ctx);
+		ERR_FAIL_NULL(wsl_ctx);
 		int err = 0;
 		int err = 0;
 		if ((err = wslay_event_recv(wsl_ctx)) != 0 || (err = wslay_event_send(wsl_ctx)) != 0) {
 		if ((err = wslay_event_recv(wsl_ctx)) != 0 || (err = wslay_event_send(wsl_ctx)) != 0) {
 			// Error close.
 			// Error close.

+ 7 - 7
platform/macos/display_server_macos.mm

@@ -1763,37 +1763,37 @@ void DisplayServerMacOS::global_menu_clear(const String &p_menu_root) {
 }
 }
 
 
 bool DisplayServerMacOS::tts_is_speaking() const {
 bool DisplayServerMacOS::tts_is_speaking() const {
-	ERR_FAIL_COND_V_MSG(!tts, false, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
+	ERR_FAIL_NULL_V_MSG(tts, false, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
 	return [tts isSpeaking];
 	return [tts isSpeaking];
 }
 }
 
 
 bool DisplayServerMacOS::tts_is_paused() const {
 bool DisplayServerMacOS::tts_is_paused() const {
-	ERR_FAIL_COND_V_MSG(!tts, false, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
+	ERR_FAIL_NULL_V_MSG(tts, false, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
 	return [tts isPaused];
 	return [tts isPaused];
 }
 }
 
 
 TypedArray<Dictionary> DisplayServerMacOS::tts_get_voices() const {
 TypedArray<Dictionary> DisplayServerMacOS::tts_get_voices() const {
-	ERR_FAIL_COND_V_MSG(!tts, Array(), "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
+	ERR_FAIL_NULL_V_MSG(tts, Array(), "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
 	return [tts getVoices];
 	return [tts getVoices];
 }
 }
 
 
 void DisplayServerMacOS::tts_speak(const String &p_text, const String &p_voice, int p_volume, float p_pitch, float p_rate, int p_utterance_id, bool p_interrupt) {
 void DisplayServerMacOS::tts_speak(const String &p_text, const String &p_voice, int p_volume, float p_pitch, float p_rate, int p_utterance_id, bool p_interrupt) {
-	ERR_FAIL_COND_MSG(!tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
+	ERR_FAIL_NULL_MSG(tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
 	[tts speak:p_text voice:p_voice volume:p_volume pitch:p_pitch rate:p_rate utterance_id:p_utterance_id interrupt:p_interrupt];
 	[tts speak:p_text voice:p_voice volume:p_volume pitch:p_pitch rate:p_rate utterance_id:p_utterance_id interrupt:p_interrupt];
 }
 }
 
 
 void DisplayServerMacOS::tts_pause() {
 void DisplayServerMacOS::tts_pause() {
-	ERR_FAIL_COND_MSG(!tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
+	ERR_FAIL_NULL_MSG(tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
 	[tts pauseSpeaking];
 	[tts pauseSpeaking];
 }
 }
 
 
 void DisplayServerMacOS::tts_resume() {
 void DisplayServerMacOS::tts_resume() {
-	ERR_FAIL_COND_MSG(!tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
+	ERR_FAIL_NULL_MSG(tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
 	[tts resumeSpeaking];
 	[tts resumeSpeaking];
 }
 }
 
 
 void DisplayServerMacOS::tts_stop() {
 void DisplayServerMacOS::tts_stop() {
-	ERR_FAIL_COND_MSG(!tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
+	ERR_FAIL_NULL_MSG(tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
 	[tts stopSpeaking];
 	[tts stopSpeaking];
 }
 }
 
 

+ 2 - 2
platform/windows/display_server_windows.cpp

@@ -2407,7 +2407,7 @@ void DisplayServerWindows::set_native_icon(const String &p_filename) {
 	f->seek(pos);
 	f->seek(pos);
 	f->get_buffer((uint8_t *)&data_big.write[0], bytecount_big);
 	f->get_buffer((uint8_t *)&data_big.write[0], bytecount_big);
 	HICON icon_big = CreateIconFromResource((PBYTE)&data_big.write[0], bytecount_big, TRUE, 0x00030000);
 	HICON icon_big = CreateIconFromResource((PBYTE)&data_big.write[0], bytecount_big, TRUE, 0x00030000);
-	ERR_FAIL_COND_MSG(!icon_big, "Could not create " + itos(big_icon_width) + "x" + itos(big_icon_width) + " @" + itos(big_icon_cc) + " icon, error: " + format_error_message(GetLastError()) + ".");
+	ERR_FAIL_NULL_MSG(icon_big, "Could not create " + itos(big_icon_width) + "x" + itos(big_icon_width) + " @" + itos(big_icon_cc) + " icon, error: " + format_error_message(GetLastError()) + ".");
 
 
 	// Read the small icon.
 	// Read the small icon.
 	DWORD bytecount_small = icon_dir->idEntries[small_icon_index].dwBytesInRes;
 	DWORD bytecount_small = icon_dir->idEntries[small_icon_index].dwBytesInRes;
@@ -2417,7 +2417,7 @@ void DisplayServerWindows::set_native_icon(const String &p_filename) {
 	f->seek(pos);
 	f->seek(pos);
 	f->get_buffer((uint8_t *)&data_small.write[0], bytecount_small);
 	f->get_buffer((uint8_t *)&data_small.write[0], bytecount_small);
 	HICON icon_small = CreateIconFromResource((PBYTE)&data_small.write[0], bytecount_small, TRUE, 0x00030000);
 	HICON icon_small = CreateIconFromResource((PBYTE)&data_small.write[0], bytecount_small, TRUE, 0x00030000);
-	ERR_FAIL_COND_MSG(!icon_small, "Could not create 16x16 @" + itos(small_icon_cc) + " icon, error: " + format_error_message(GetLastError()) + ".");
+	ERR_FAIL_NULL_MSG(icon_small, "Could not create 16x16 @" + itos(small_icon_cc) + " icon, error: " + format_error_message(GetLastError()) + ".");
 
 
 	// Online tradition says to be sure last error is cleared and set the small icon first.
 	// Online tradition says to be sure last error is cleared and set the small icon first.
 	int err = 0;
 	int err = 0;

+ 1 - 1
thirdparty/enet/godot.cpp

@@ -484,7 +484,7 @@ void enet_socket_destroy(ENetSocket socket) {
 }
 }
 
 
 int enet_socket_send(ENetSocket socket, const ENetAddress *address, const ENetBuffer *buffers, size_t bufferCount) {
 int enet_socket_send(ENetSocket socket, const ENetAddress *address, const ENetBuffer *buffers, size_t bufferCount) {
-	ERR_FAIL_COND_V(address == nullptr, -1);
+	ERR_FAIL_NULL_V(address, -1);
 
 
 	ENetGodotSocket *sock = (ENetGodotSocket *)socket;
 	ENetGodotSocket *sock = (ENetGodotSocket *)socket;
 	IPAddress dest;
 	IPAddress dest;

Некоторые файлы не были показаны из-за большого количества измененных файлов