Fix wrong object mode checking in snap code

The value of `OB_MODE_OBJECT` is 0, this makes it unsuitable as a bitflag.

Issue pointed out at https://pvs-studio.com/en/blog/posts/cpp/0922/

Thanks to Andrey Karpov
This commit is contained in:
Germano Cavalcante 2022-03-01 16:11:38 -03:00
parent 8322a4f6b7
commit 8e88af9934
1 changed files with 1 additions and 1 deletions

View File

@ -491,7 +491,7 @@ static void iter_snap_objects(SnapObjectContext *sctx,
}
}
else if (snap_select == SNAP_NOT_SELECTED) {
if (is_object_active && !(base->object->mode & OB_MODE_OBJECT)) {
if (is_object_active && base->object->mode != OB_MODE_OBJECT) {
/* Pass. Consider the selection of elements being edited. */
}
else if ((base->flag & BASE_SELECTED) || (base->flag_legacy & BA_WAS_SEL)) {