Skip to content

Commit 5763a4e

Browse files
committed
[ivp_collision] Fixed a bug
This could break the entire physics engine for an entire session.
1 parent 94312b4 commit 5763a4e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ivp_intern/ivp_impact.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,8 +1239,11 @@ void IVP_Mindist::do_impact(){
12391239
if (g_fDeferDeleteMindist)
12401240
{
12411241
// BUGBUG: someone changed a collision filter and didn't tell us!
1242-
IVP_ASSERT(0);
1243-
delete this;
1242+
// Calling recheck_collision_filter should fix it and stop it from breaking the entire engine. (Never call "delete this;" here).
1243+
// In most cases, this IVP_Mindist will also be deleted from recheck_collision_filter.
1244+
for (int i = 0;i<2;i++){
1245+
objects[i]->recheck_collision_filter();
1246+
}
12441247
return;
12451248
}
12461249

0 commit comments

Comments
 (0)