From 51be3bd1cb47a824144a3f9eddd72c5a5f7306b5 Mon Sep 17 00:00:00 2001 From: Christian Godenschwager <christian.godenschwager@fau.de> Date: Fri, 4 May 2018 16:06:27 +0200 Subject: [PATCH] Assert that pe body's type id is initialized when requested --- src/pe/rigidbody/RigidBody.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pe/rigidbody/RigidBody.h b/src/pe/rigidbody/RigidBody.h index 119616748..004423cc1 100644 --- a/src/pe/rigidbody/RigidBody.h +++ b/src/pe/rigidbody/RigidBody.h @@ -1170,7 +1170,11 @@ const Vec3 RigidBody::accFromWF( real_t px, real_t py, real_t pz ) const } //************************************************************************************************* -inline id_t RigidBody::getTypeID() const{ +inline id_t RigidBody::getTypeID() const +{ + WALBERLA_ASSERT_LESS( typeID_, std::numeric_limits<id_t>::max(), "You are requesting the type " \ + " id of a body, but the static type id for the body has not yet been " \ + " initialized! Call SetBodyTypeIDs<BodyTypeTuple>::execute to initialize!" ); return typeID_; } -- GitLab