Skip to content

Commit ac24ca9

Browse files
author
Goober5000
committed
use IS_VEC_NULL for floating point safety, plus a few minor touchups
1 parent d085951 commit ac24ca9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fred2/orienteditor.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ void orient_editor::update_object(object *ptr)
210210
vec3d v, loc;
211211
matrix m;
212212

213-
memset(&v, 0, sizeof(vec3d));
213+
vm_vec_zero(&v);
214214
loc.xyz.x = convert(m_location_x);
215215
loc.xyz.y = convert(m_location_y);
216216
loc.xyz.z = convert(m_location_z);
@@ -223,10 +223,11 @@ void orient_editor::update_object(object *ptr)
223223
vm_vec_sub(&v, &loc, &ptr->pos);
224224

225225
} else {
226-
Assert(0); // neither radio button is checked.
226+
Assertion(0, "neither radio button is checked!");
227+
return;
227228
}
228229

229-
if (!v.xyz.x && !v.xyz.y && !v.xyz.z){
230+
if (IS_VEC_NULL(&v)) {
230231
return; // can't point to itself.
231232
}
232233

0 commit comments

Comments
 (0)