Skip to content

Commit eb1389d

Browse files
authored
Merge pull request #1208 from The-E/LikeARecordBabyRightRound
Changes the "Object rotated too far" assertion to a log message
2 parents 589eb75 + b319143 commit eb1389d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

code/ai/aicode.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,10 +1213,9 @@ void ai_turn_towards_vector(vec3d *dest, object *objp, float frametime, float tu
12131213
}
12141214

12151215
// Dave Andsager: The non-indented lines here are debug code to help you track down the problem in the physics
1216-
// that is causing ships to inexplicably rotate very far. If you hit the Int3(), set the next statement to be
1216+
// that is causing ships to inexplicably rotate very far. If you see the message below in the log, set the next statement to be
12171217
// the one marked "HERE". (Do this clicking the cursor there, then right clicking. Choose the right option.)
12181218
// This will allow you to rerun vm_forward_interpolate() with the values that caused the error.
1219-
// Note, you'll need to enable the Int3() about ten lines below.
12201219
#ifndef NDEBUG
12211220
vec3d tvec = objp->orient.vec.fvec;
12221221
vec3d vel_in_copy;
@@ -1240,11 +1239,11 @@ objp->orient = objp_orient_copy; //-V587
12401239
}
12411240

12421241
#ifndef NDEBUG
1243-
if (!((objp->type == OBJ_WEAPON) && (Weapon_info[Weapons[objp->instance].weapon_info_index].subtype == WP_MISSILE))) {
1244-
Assertion(!(delta_time < 0.25f && vm_vec_dot(&objp->orient.vec.fvec, &tvec) < 0.1f), "A ship rotated too far. Offending vessel is %s, please investigate.\n", Ships[objp->instance].ship_name);
1242+
if (!((objp->type == OBJ_WEAPON) && (Weapon_info[Weapons[objp->instance].weapon_info_index].subtype == WP_MISSILE))) {
1243+
if (!(delta_time < 0.25f && vm_vec_dot(&objp->orient.vec.fvec, &tvec) < 0.1f))
1244+
mprintf(("A ship rotated too far. Offending vessel is %s, please investigate.\n", Ships[objp->instance].ship_name));
12451245
}
12461246
#endif
1247-
12481247
pip->rotvel = vel_out;
12491248
}
12501249

0 commit comments

Comments
 (0)