Browse Source

Clarify invalid RID errors in Server free() functions.

Cory Petkovsek 3 years ago
parent
commit
d7ba3b73a9

+ 2 - 2
modules/bullet/bullet_physics_server.cpp

@@ -1481,7 +1481,7 @@ bool BulletPhysicsServer::generic_6dof_joint_get_flag(RID p_joint, Vector3::Axis
 
 
 void BulletPhysicsServer::free(RID p_rid) {
 void BulletPhysicsServer::free(RID p_rid) {
 	if (!p_rid.is_valid()) {
 	if (!p_rid.is_valid()) {
-		ERR_FAIL_MSG("Invalid RID.");
+		ERR_FAIL_MSG("PhysicsServer attempted to free a NULL RID.");
 		return;
 		return;
 	}
 	}
 
 
@@ -1540,7 +1540,7 @@ void BulletPhysicsServer::free(RID p_rid) {
 		bulletdelete(space);
 		bulletdelete(space);
 
 
 	} else {
 	} else {
-		ERR_FAIL_MSG("Invalid RID.");
+		ERR_FAIL_MSG("RID not found by PhysicsServer.");
 	}
 	}
 }
 }
 
 

+ 2 - 2
modules/navigation/godot_navigation_server.cpp

@@ -554,7 +554,7 @@ COMMAND_4(agent_set_callback, RID, p_agent, Object *, p_receiver, StringName, p_
 
 
 COMMAND_1(free, RID, p_object) {
 COMMAND_1(free, RID, p_object) {
 	if (!p_object.is_valid()) {
 	if (!p_object.is_valid()) {
-		ERR_FAIL_MSG("Invalid RID.");
+		ERR_FAIL_MSG("NavigationServer attempted to free a NULL RID.");
 		return;
 		return;
 	}
 	}
 	if (map_owner.owns(p_object)) {
 	if (map_owner.owns(p_object)) {
@@ -605,7 +605,7 @@ COMMAND_1(free, RID, p_object) {
 		memdelete(agent);
 		memdelete(agent);
 
 
 	} else {
 	} else {
-		ERR_FAIL_COND("Invalid RID.");
+		ERR_FAIL_COND("RID not found by NavigationServer.");
 	}
 	}
 }
 }
 
 

+ 2 - 2
servers/physics/physics_server_sw.cpp

@@ -1200,7 +1200,7 @@ bool PhysicsServerSW::generic_6dof_joint_get_flag(RID p_joint, Vector3::Axis p_a
 
 
 void PhysicsServerSW::free(RID p_rid) {
 void PhysicsServerSW::free(RID p_rid) {
 	if (!p_rid.is_valid()) {
 	if (!p_rid.is_valid()) {
-		ERR_FAIL_MSG("Invalid RID.");
+		ERR_FAIL_MSG("PhysicsServer attempted to free a NULL RID.");
 		return;
 		return;
 	}
 	}
 
 
@@ -1279,7 +1279,7 @@ void PhysicsServerSW::free(RID p_rid) {
 		memdelete(joint);
 		memdelete(joint);
 
 
 	} else {
 	} else {
-		ERR_FAIL_MSG("Invalid RID.");
+		ERR_FAIL_MSG("RID not found by PhysicsServer.");
 	}
 	}
 };
 };
 
 

+ 2 - 2
servers/physics_2d/physics_2d_server_sw.cpp

@@ -1122,7 +1122,7 @@ Physics2DServer::JointType Physics2DServerSW::joint_get_type(RID p_joint) const
 
 
 void Physics2DServerSW::free(RID p_rid) {
 void Physics2DServerSW::free(RID p_rid) {
 	if (!p_rid.is_valid()) {
 	if (!p_rid.is_valid()) {
-		ERR_FAIL_MSG("Invalid RID.");
+		ERR_FAIL_MSG("PhysicsServer attempted to free a NULL RID.");
 		return;
 		return;
 	}
 	}
 
 
@@ -1195,7 +1195,7 @@ void Physics2DServerSW::free(RID p_rid) {
 		memdelete(joint);
 		memdelete(joint);
 
 
 	} else {
 	} else {
-		ERR_FAIL_MSG("Invalid RID.");
+		ERR_FAIL_MSG("RID not found by PhysicsServer.");
 	}
 	}
 };
 };
 
 

+ 2 - 2
servers/visual/visual_server_raster.cpp

@@ -66,7 +66,7 @@ void VisualServerRaster::_draw_margins() {
 
 
 void VisualServerRaster::free(RID p_rid) {
 void VisualServerRaster::free(RID p_rid) {
 	if (!p_rid.is_valid()) {
 	if (!p_rid.is_valid()) {
-		ERR_FAIL_MSG("Invalid RID.");
+		ERR_FAIL_MSG("VisualServer attempted to free a NULL RID.");
 		return;
 		return;
 	}
 	}
 
 
@@ -86,7 +86,7 @@ void VisualServerRaster::free(RID p_rid) {
 		return;
 		return;
 	}
 	}
 
 
-	ERR_FAIL_MSG("Invalid RID.");
+	ERR_FAIL_MSG("RID not found by VisualServer.");
 }
 }
 
 
 /* EVENT QUEUING */
 /* EVENT QUEUING */