entity: review of entt_traits<T>::to_type
This commit is contained in:
@@ -120,7 +120,7 @@ public:
|
||||
* @return A properly constructed identifier.
|
||||
*/
|
||||
[[nodiscard]] static constexpr auto to_type(const entity_type entity, const version_type version = {}) {
|
||||
return Type{entity | (version << traits_type::entity_shift)};
|
||||
return Type{(entity & traits_type::entity_mask) | (version << traits_type::entity_shift)};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ TEST(Entity, Traits) {
|
||||
|
||||
ASSERT_EQ(traits_type::to_type(traits_type::to_entity(entity), traits_type::to_version(entity)), entity);
|
||||
ASSERT_EQ(traits_type::to_type(traits_type::to_entity(other), traits_type::to_version(other)), other);
|
||||
ASSERT_NE(traits_type::to_type(traits_type::to_integral(entity)), entity);
|
||||
}
|
||||
|
||||
TEST(Entity, Null) {
|
||||
|
||||
Reference in New Issue
Block a user