Destroy central item when placing card
This commit is contained in:
parent
9bde6bbed3
commit
9f2697d87d
1 changed files with 14 additions and 0 deletions
|
|
@ -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<path_index>().get(selected_->down());
|
||||
if (auto o = map_.world->get(e).get_if<occupied>())
|
||||
{
|
||||
map_.world->destroy(o->entity);
|
||||
map_.world->detach<occupied>(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1493,6 +1500,13 @@ namespace gmtk
|
|||
{
|
||||
active_card_ = std::nullopt;
|
||||
built_sound();
|
||||
|
||||
auto e = map_.world->index<path_index>().get(selected_->down());
|
||||
if (auto o = map_.world->get(e).get_if<occupied>())
|
||||
{
|
||||
map_.world->destroy(o->entity);
|
||||
map_.world->detach<occupied>(e);
|
||||
}
|
||||
}
|
||||
|
||||
if (built && tutorial_state_ <= 3)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue