Merge pull request #337 from JupiterRider/master

physics.GetBodies: return only non nil (active) bodies
This commit is contained in:
Milan Nikolic 2024-01-09 17:17:35 +01:00 committed by GitHub
commit b32467e017
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -526,7 +526,7 @@ func Shatter(body *Body, position rl.Vector2, force float32) {
// GetBodies - Returns the slice of created physics bodies
func GetBodies() []*Body {
return bodies[:]
return bodies[:bodiesCount]
}
// GetBodiesCount - Returns the current amount of created physics bodies