Skip to content

Commit

Permalink
Clarify invalid RID errors in Server free() functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
TokisanGames committed Aug 12, 2022
1 parent 850c5cc commit d7ba3b7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions modules/bullet/bullet_physics_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,7 @@ bool BulletPhysicsServer::generic_6dof_joint_get_flag(RID p_joint, Vector3::Axis

void BulletPhysicsServer::free(RID p_rid) {
if (!p_rid.is_valid()) {
ERR_FAIL_MSG("Invalid RID.");
ERR_FAIL_MSG("PhysicsServer attempted to free a NULL RID.");
return;
}

Expand Down Expand Up @@ -1540,7 +1540,7 @@ void BulletPhysicsServer::free(RID p_rid) {
bulletdelete(space);

} else {
ERR_FAIL_MSG("Invalid RID.");
ERR_FAIL_MSG("RID not found by PhysicsServer.");
}
}

Expand Down
4 changes: 2 additions & 2 deletions modules/navigation/godot_navigation_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ COMMAND_4(agent_set_callback, RID, p_agent, Object *, p_receiver, StringName, p_

COMMAND_1(free, RID, p_object) {
if (!p_object.is_valid()) {
ERR_FAIL_MSG("Invalid RID.");
ERR_FAIL_MSG("NavigationServer attempted to free a NULL RID.");
return;
}
if (map_owner.owns(p_object)) {
Expand Down Expand Up @@ -605,7 +605,7 @@ COMMAND_1(free, RID, p_object) {
memdelete(agent);

} else {
ERR_FAIL_COND("Invalid RID.");
ERR_FAIL_COND("RID not found by NavigationServer.");
}
}

Expand Down
4 changes: 2 additions & 2 deletions servers/physics/physics_server_sw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,7 @@ bool PhysicsServerSW::generic_6dof_joint_get_flag(RID p_joint, Vector3::Axis p_a

void PhysicsServerSW::free(RID p_rid) {
if (!p_rid.is_valid()) {
ERR_FAIL_MSG("Invalid RID.");
ERR_FAIL_MSG("PhysicsServer attempted to free a NULL RID.");
return;
}

Expand Down Expand Up @@ -1279,7 +1279,7 @@ void PhysicsServerSW::free(RID p_rid) {
memdelete(joint);

} else {
ERR_FAIL_MSG("Invalid RID.");
ERR_FAIL_MSG("RID not found by PhysicsServer.");
}
};

Expand Down
4 changes: 2 additions & 2 deletions servers/physics_2d/physics_2d_server_sw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ Physics2DServer::JointType Physics2DServerSW::joint_get_type(RID p_joint) const

void Physics2DServerSW::free(RID p_rid) {
if (!p_rid.is_valid()) {
ERR_FAIL_MSG("Invalid RID.");
ERR_FAIL_MSG("PhysicsServer attempted to free a NULL RID.");
return;
}

Expand Down Expand Up @@ -1195,7 +1195,7 @@ void Physics2DServerSW::free(RID p_rid) {
memdelete(joint);

} else {
ERR_FAIL_MSG("Invalid RID.");
ERR_FAIL_MSG("RID not found by PhysicsServer.");
}
};

Expand Down
4 changes: 2 additions & 2 deletions servers/visual/visual_server_raster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void VisualServerRaster::_draw_margins() {

void VisualServerRaster::free(RID p_rid) {
if (!p_rid.is_valid()) {
ERR_FAIL_MSG("Invalid RID.");
ERR_FAIL_MSG("VisualServer attempted to free a NULL RID.");
return;
}

Expand All @@ -86,7 +86,7 @@ void VisualServerRaster::free(RID p_rid) {
return;
}

ERR_FAIL_MSG("Invalid RID.");
ERR_FAIL_MSG("RID not found by VisualServer.");
}

/* EVENT QUEUING */
Expand Down

0 comments on commit d7ba3b7

Please sign in to comment.