diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 66edeaaea..6b6db20b9 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -628,7 +628,6 @@ void CPlayerInterface::buildChanged(const CGTownInstance *town, BuildingID build switch(what) { case 1: - CCS->soundh->playSound(soundBase::newBuilding); castleInt->addBuilding(buildingID); break; case 2: @@ -1415,7 +1414,6 @@ void CPlayerInterface::newObject( const CGObjectInstance * obj ) && LOCPLINT->castleInt && obj->visitablePos() == LOCPLINT->castleInt->town->bestLocation()) { - CCS->soundh->playSound(soundBase::newBuilding); LOCPLINT->castleInt->addBuilding(BuildingID::SHIP); } } diff --git a/client/windows/CCastleInterface.cpp b/client/windows/CCastleInterface.cpp index 7549e793b..4806e2fb4 100644 --- a/client/windows/CCastleInterface.cpp +++ b/client/windows/CCastleInterface.cpp @@ -24,6 +24,7 @@ #include "../gui/Shortcut.h" #include "../gui/WindowHandler.h" #include "../media/IMusicPlayer.h" +#include "../media/ISoundPlayer.h" #include "../widgets/MiscWidgets.h" #include "../widgets/CComponent.h" #include "../widgets/CGarrisonInt.h" @@ -1435,6 +1436,9 @@ void CCastleInterface::townChange() void CCastleInterface::addBuilding(BuildingID bid) { + if (town->getTown()->buildings.at(bid)->mode != CBuilding::BUILD_AUTO) + CCS->soundh->playSound(soundBase::newBuilding); + deactivate(); builds->addBuilding(bid); recreateIcons();