diff options
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/baked_lightmap.cpp | 4 | ||||
-rw-r--r-- | scene/3d/cpu_particles.cpp | 6 | ||||
-rw-r--r-- | scene/3d/navigation.cpp | 2 | ||||
-rw-r--r-- | scene/3d/particles.cpp | 4 | ||||
-rw-r--r-- | scene/3d/physics_body.cpp | 4 |
5 files changed, 10 insertions, 10 deletions
diff --git a/scene/3d/baked_lightmap.cpp b/scene/3d/baked_lightmap.cpp index b70e6dbc5d..4b1eccb40d 100644 --- a/scene/3d/baked_lightmap.cpp +++ b/scene/3d/baked_lightmap.cpp @@ -88,7 +88,7 @@ float BakedLightmapData::get_energy() const { void BakedLightmapData::add_user(const NodePath &p_path, const Ref<Texture> &p_lightmap, int p_instance) { - ERR_FAIL_COND(p_lightmap.is_null()); + ERR_FAIL_COND_MSG(p_lightmap.is_null(), "It's not a reference to a valid Texture object."); User user; user.path = p_path; user.lightmap = p_lightmap; @@ -360,7 +360,7 @@ BakedLightmap::BakeError BakedLightmap::bake(Node *p_from_node, bool p_create_vi //check for valid save path DirAccessRef d = DirAccess::open(save_path); if (!d) { - ERR_PRINTS("Invalid Save Path: " + save_path); + ERR_PRINTS("Invalid Save Path '" + save_path + "'."); return BAKE_ERROR_NO_SAVE_PATH; } } diff --git a/scene/3d/cpu_particles.cpp b/scene/3d/cpu_particles.cpp index 4cb94225b4..93ff60bc4e 100644 --- a/scene/3d/cpu_particles.cpp +++ b/scene/3d/cpu_particles.cpp @@ -53,7 +53,7 @@ void CPUParticles::set_emitting(bool p_emitting) { void CPUParticles::set_amount(int p_amount) { - ERR_FAIL_COND(p_amount < 1); + ERR_FAIL_COND_MSG(p_amount < 1, "Amount of particles must be greater than 0."); particles.resize(p_amount); { @@ -71,7 +71,7 @@ void CPUParticles::set_amount(int p_amount) { } void CPUParticles::set_lifetime(float p_lifetime) { - ERR_FAIL_COND(p_lifetime <= 0); + ERR_FAIL_COND_MSG(p_lifetime <= 0, "Particles lifetime must be greater than 0."); lifetime = p_lifetime; } @@ -1193,7 +1193,7 @@ void CPUParticles::_notification(int p_what) { void CPUParticles::convert_from_particles(Node *p_particles) { Particles *particles = Object::cast_to<Particles>(p_particles); - ERR_FAIL_COND(!particles); + ERR_FAIL_COND_MSG(!particles, "Only Particles nodes can be converted to CPUParticles."); set_emitting(particles->is_emitting()); set_amount(particles->get_amount()); diff --git a/scene/3d/navigation.cpp b/scene/3d/navigation.cpp index 12d562c0c6..ba0460d47c 100644 --- a/scene/3d/navigation.cpp +++ b/scene/3d/navigation.cpp @@ -230,7 +230,7 @@ void Navigation::navmesh_set_transform(int p_id, const Transform &p_xform) { } void Navigation::navmesh_remove(int p_id) { - ERR_FAIL_COND(!navmesh_map.has(p_id)); + ERR_FAIL_COND_MSG(!navmesh_map.has(p_id), "Trying to remove nonexisting navmesh with id: " + itos(p_id)); _navmesh_unlink(p_id); navmesh_map.erase(p_id); } diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index a6ccdb5791..241eb7d1ca 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -57,13 +57,13 @@ void Particles::set_emitting(bool p_emitting) { void Particles::set_amount(int p_amount) { - ERR_FAIL_COND(p_amount < 1); + ERR_FAIL_COND_MSG(p_amount < 1, "Amount of particles cannot be smaller than 1."); amount = p_amount; VS::get_singleton()->particles_set_amount(particles, amount); } void Particles::set_lifetime(float p_lifetime) { - ERR_FAIL_COND(p_lifetime <= 0); + ERR_FAIL_COND_MSG(p_lifetime <= 0, "Particles lifetime must be greater than 0."); lifetime = p_lifetime; VS::get_singleton()->particles_set_lifetime(particles, lifetime); } diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index 71040d2d68..a02cc4bee6 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -188,7 +188,7 @@ void StaticBody::set_friction(real_t p_friction) { WARN_DEPRECATED_MSG("The method set_friction has been deprecated and will be removed in the future, use physics material instead."); - ERR_FAIL_COND(p_friction < 0 || p_friction > 1); + ERR_FAIL_COND_MSG(p_friction < 0 || p_friction > 1, "Friction must be between 0 and 1."); if (physics_material_override.is_null()) { physics_material_override.instance(); @@ -216,7 +216,7 @@ void StaticBody::set_bounce(real_t p_bounce) { WARN_DEPRECATED_MSG("The method set_bounce has been deprecated and will be removed in the future, use physics material instead."); - ERR_FAIL_COND(p_bounce < 0 || p_bounce > 1); + ERR_FAIL_COND_MSG(p_bounce < 0 || p_bounce > 1, "Bounce must be between 0 and 1."); if (physics_material_override.is_null()) { physics_material_override.instance(); |