diff --git a/src/render/gui/TowerPlacePopup.cpp b/src/render/gui/TowerPlacePopup.cpp index 398d1ad..3fb6683 100644 --- a/src/render/gui/TowerPlacePopup.cpp +++ b/src/render/gui/TowerPlacePopup.cpp @@ -44,7 +44,10 @@ void TowerPlacePopup::render() { ImGui::SetCursorPosY(m_TowerPopupTileHeight - m_PlaceTowerButtonHeight - 10); ImGui::SetCursorPosX(m_TowerPopupTileWidth / 2.0f - m_PlaceTowerButtonWidth / 2.0f); - ImGui::Button(buyText.c_str(), ImVec2(m_PlaceTowerButtonWidth, m_PlaceTowerButtonHeight)); + if(ImGui::Button(buyText.c_str(), ImVec2(m_PlaceTowerButtonWidth, m_PlaceTowerButtonHeight))){ + getClient()->placeTower(towerType, m_ClickWorldPos); + ImGui::CloseCurrentPopup(); + } ImGui::EndChild(); }