Fix: Assert with set origin operation and single active object

Array has bounds checking that a raw pointer didn't have before.
This commit is contained in:
Hans Goudey 2022-04-01 23:22:17 -05:00
parent ad35453cd1
commit a567bef5cc
1 changed files with 2 additions and 2 deletions

View File

@ -1263,12 +1263,12 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
}
/* reset flags */
for (int object_index = 0; object_index < objects.size(); object_index++) {
for (const int object_index : objects.index_range()) {
Object *ob = objects[object_index];
ob->flag &= ~OB_DONE;
/* move active first */
if (ob == obact) {
if (ob == obact && objects.size() > 1) {
memmove(&objects[1], objects.data(), object_index * sizeof(Object *));
objects[0] = ob;
}