Commit f57f4bf8 authored by Elias Broschin's avatar Elias Broschin
Browse files

quick fix

parent a937181f
......@@ -17,7 +17,7 @@ namespace gdw{
collision_component(engine &engine, entity &owner, gdw::collision_shape* col_shape);
~collision_component();
gdw::collision_shape* collision_shape() {return collision_shape_;}
gdw::collision_shape* collision_shape() {return collision_shape_.get();}
void set_trigger(std::function<void()> trigger) {trigger_ = trigger;}
void call_trigger() {trigger_();}
......@@ -25,7 +25,7 @@ namespace gdw{
return gdw::type_id<gdw::collision_component>();
}
private:
gdw::collision_shape* collision_shape_;
std::unique_ptr<gdw::collision_shape> collision_shape_;
std::function<void()> trigger_;
};
}
......
......@@ -10,7 +10,7 @@ namespace gdw{
collision_component::collision_component(engine& engine, entity& owner, gdw::collision_shape* col_shape):
component(engine,owner) {
engine_.physics_system().register_collision_component(this);
collision_shape_ = col_shape;
collision_shape_ = std::move(std::unique_ptr<gdw::collision_shape>(col_shape));
collision_shape_->set_owner(&owner);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment