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 "core/physics/physics_world.hpp"
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
#include "core/physics/rigid_body.hpp"
|
#include "core/physics/rigid_body.hpp"
|
||||||
@@ -14,9 +13,12 @@ namespace Physics {
|
|||||||
if (body == nullptr) {
|
if (body == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (std::ranges::find(bodies_, body) == bodies_.end()) {
|
for (const auto* b : bodies_) {
|
||||||
bodies_.push_back(body);
|
if (b == body) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
bodies_.push_back(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PhysicsWorld::removeBody(RigidBody* body) {
|
void PhysicsWorld::removeBody(RigidBody* body) {
|
||||||
|
|||||||
Reference in New Issue
Block a user