mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-28 14:08:29 +00:00
fix various problems, thanks CppCheck :) (#1005)
* explained a bit more the core_window_letterbox example * fixed a few 'ups' moments that could lead to mild head pain and time loss
This commit is contained in:
27
src/physac.h
27
src/physac.h
@@ -842,9 +842,17 @@ PHYSACDEF void DestroyPhysicsBody(PhysicsBody body)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(PHYSAC_DEBUG)
|
||||
if (index == -1) printf("[PHYSAC] cannot find body id %i in pointers array\n", id);
|
||||
#endif
|
||||
|
||||
if (index == -1){
|
||||
|
||||
#if defined(PHYSAC_DEBUG)
|
||||
printf("[PHYSAC] cannot find body id %i in pointers array\n", id);
|
||||
#endif
|
||||
|
||||
// prevent access to index -1
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Free body allocated memory
|
||||
PHYSAC_FREE(body);
|
||||
@@ -1249,9 +1257,16 @@ static void DestroyPhysicsManifold(PhysicsManifold manifold)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(PHYSAC_DEBUG)
|
||||
if (index == -1) printf("[PHYSAC] cannot find manifold id %i in pointers array\n", id);
|
||||
#endif
|
||||
|
||||
if (index == -1) {
|
||||
#if defined(PHYSAC_DEBUG)
|
||||
printf("[PHYSAC] cannot find manifold id %i in pointers array\n", id);
|
||||
#endif
|
||||
|
||||
//prevent access to index -1
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Free manifold allocated memory
|
||||
PHYSAC_FREE(manifold);
|
||||
|
Reference in New Issue
Block a user