We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c3f1963 + bf2ca61 commit d085951Copy full SHA for d085951
fred2/orienteditor.cpp
@@ -215,9 +215,10 @@ void orient_editor::update_object(object *ptr)
215
loc.xyz.y = convert(m_location_y);
216
loc.xyz.z = convert(m_location_z);
217
if (((CButton *) GetDlgItem(IDC_POINT_TO_OBJECT))->GetCheck() == 1) {
218
- v = Objects[index[m_object_index]].pos;
219
- vm_vec_sub2(&v, &ptr->pos);
220
-
+ if (m_object_index >= 0) {
+ v = Objects[index[m_object_index]].pos;
+ vm_vec_sub2(&v, &ptr->pos);
221
+ }
222
} else if (((CButton *) GetDlgItem(IDC_POINT_TO_LOCATION))->GetCheck() == 1) {
223
vm_vec_sub(&v, &loc, &ptr->pos);
224
0 commit comments