SDLPP colidesWith: only add id once
Before this change collision id was added for every collision it was a part of, but we only want that id once (the collider collided, that's all that matters)
This commit is contained in:
parent
757a03568d
commit
db338fd544
@ -55,8 +55,10 @@ RenderObject::colidesWith( const RenderObject &other ) const {
|
|||||||
std::vector< uint64_t > ret = {};
|
std::vector< uint64_t > ret = {};
|
||||||
for ( const auto &x : collisions ) {
|
for ( const auto &x : collisions ) {
|
||||||
for ( const auto &y : other.getCollisions() ) {
|
for ( const auto &y : other.getCollisions() ) {
|
||||||
if ( x->colidesWith( *y ) )
|
if ( x->colidesWith( *y ) ) {
|
||||||
ret.push_back( x->getId() );
|
ret.push_back( x->getId() );
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user