Browse Source

Do not play embark/disembar sound during enemy turn

Ivan Savenko 2 years ago
parent
commit
844bf9b9ab
1 changed files with 7 additions and 7 deletions
  1. 7 7
      client/CPlayerInterface.cpp

+ 7 - 7
client/CPlayerInterface.cpp

@@ -324,13 +324,13 @@ void CPlayerInterface::heroMoved(const TryMoveHero & details, bool verbose)
 	if (!hero)
 		return;
 
-	adventureInt->infoBar->requestPopAll();
-	if (details.result == TryMoveHero::EMBARK || details.result == TryMoveHero::DISEMBARK)
-	{
-		if (hero->getRemovalSound())
-			CCS->soundh->playSound(hero->getRemovalSound().get());
-	}
-
+	adventureInt->infoBar->requestPopAll();
+	if (details.result == TryMoveHero::EMBARK || details.result == TryMoveHero::DISEMBARK)
+	{
+		if(hero->getRemovalSound() && hero->tempOwner == playerID)
+			CCS->soundh->playSound(hero->getRemovalSound().get());
+	}
+
 	adventureInt->minimap->updateTile(hero->convertToVisitablePos(details.start));
 	adventureInt->minimap->updateTile(hero->convertToVisitablePos(details.end));