fix: access to deleted Sensor
This commit is contained in:
@@ -273,3 +273,7 @@ bool PhysicsSolver::isBlockInside(int x, int y, int z, Block* def, blockstate st
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void PhysicsSolver::removeSensor(Sensor* sensor) {
|
||||
sensors.erase(std::remove(sensors.begin(), sensors.end(), sensor), sensors.end());
|
||||
}
|
||||
|
||||
@@ -39,6 +39,8 @@ public:
|
||||
void setSensors(std::vector<Sensor*> sensors) {
|
||||
this->sensors = std::move(sensors);
|
||||
}
|
||||
|
||||
void removeSensor(Sensor* sensor);
|
||||
};
|
||||
|
||||
#endif // PHYSICS_PHYSICSSOLVER_HPP_
|
||||
|
||||
Reference in New Issue
Block a user