diff --git a/source/application.cpp b/source/application.cpp index 3dcb138..23113a3 100644 --- a/source/application.cpp +++ b/source/application.cpp @@ -1442,6 +1442,13 @@ namespace gmtk map_.put_card(transformer_to_card(t->type)); t->type = *n; active_card_ = std::nullopt; + + auto e = map_.world->index().get(selected_->down()); + if (auto o = map_.world->get(e).get_if()) + { + map_.world->destroy(o->entity); + map_.world->detach(e); + } } } } @@ -1493,6 +1500,13 @@ namespace gmtk { active_card_ = std::nullopt; built_sound(); + + auto e = map_.world->index().get(selected_->down()); + if (auto o = map_.world->get(e).get_if()) + { + map_.world->destroy(o->entity); + map_.world->detach(e); + } } if (built && tutorial_state_ <= 3)