refactor(physics): tornar std::ranges::find a bucle for explícit
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
|
||||
#include "core/physics/physics_world.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
#include "core/physics/rigid_body.hpp"
|
||||
@@ -14,9 +13,12 @@ namespace Physics {
|
||||
if (body == nullptr) {
|
||||
return;
|
||||
}
|
||||
if (std::ranges::find(bodies_, body) == bodies_.end()) {
|
||||
bodies_.push_back(body);
|
||||
for (const auto* b : bodies_) {
|
||||
if (b == body) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
bodies_.push_back(body);
|
||||
}
|
||||
|
||||
void PhysicsWorld::removeBody(RigidBody* body) {
|
||||
|
||||
Reference in New Issue
Block a user