fix: check team when placing tower
This commit is contained in:
@@ -110,7 +110,7 @@ void WorldRenderer::changeZoom(float zoomStep) {
|
||||
}
|
||||
|
||||
void WorldRenderer::click() {
|
||||
if (m_Client->getWorld().CanPlaceLittleTower(getClickWorldPos())) {
|
||||
if (m_Client->getWorld().CanPlaceLittleTower(getClickWorldPos(), m_Client->getPlayer()->getID())) {
|
||||
ImGui::OpenPopup("TowerPlace");
|
||||
m_TowerPlacePopupOpened = true;
|
||||
}
|
||||
@@ -126,7 +126,7 @@ void WorldRenderer::renderPopups() const {
|
||||
for (int i = 0; i < (int)game::TowerType::TowerCount; i++) {
|
||||
game::TowerType towerType = game::TowerType(i);
|
||||
const game::TowerInfo& towerInfo = game::getTowerInfo(towerType);
|
||||
if (!towerInfo.isBigTower() || (towerInfo.isBigTower() && m_Client->getWorld().CanPlaceBigTower(getClickWorldPos()))) {
|
||||
if (!towerInfo.isBigTower() || (towerInfo.isBigTower() && m_Client->getWorld().CanPlaceBigTower(getClickWorldPos(), m_Client->getPlayer()->getID()))) {
|
||||
if (ImGui::Button(game::getTowerInfo(towerType).getName().c_str())) {
|
||||
m_Client->PlaceTower(towerType, getClickWorldPos());
|
||||
ImGui::CloseCurrentPopup();
|
||||
|
||||
Reference in New Issue
Block a user