diff --git a/source/glest_game/type_instances/faction.cpp b/source/glest_game/type_instances/faction.cpp index 0652606f..d70b81ab 100644 --- a/source/glest_game/type_instances/faction.cpp +++ b/source/glest_game/type_instances/faction.cpp @@ -844,7 +844,7 @@ void Faction::applyCostsOnInterval(const ResourceType *rtApply) { } StaticSound *sound= unit->getType()->getFirstStOfClass(scDie)->getSound(); if(sound != NULL && - (thisFaction == true || (world->getThisTeamIndex() == GameConstants::maxPlayers -1 + fpt_Observer))) { + (thisFaction == true || world->showWorldForPlayer(world->getThisTeamIndex()) == true)) { SoundRenderer::getInstance().playFx(sound); } } diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index 14475517..f35d484f 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -1911,7 +1911,7 @@ bool Unit::applyAttackBoost(const AttackBoost *boost, const Unit *source) { StaticSound *sound= this->getType()->getFirstStOfClass(scDie)->getSound(); if(sound != NULL && (this->getFactionIndex() == Unit::game->getWorld()->getThisFactionIndex() || - (game->getWorld()->getThisTeamIndex() == GameConstants::maxPlayers -1 + fpt_Observer))) { + (game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true))) { SoundRenderer::getInstance().playFx(sound); } @@ -1980,7 +1980,7 @@ void Unit::deapplyAttackBoost(const AttackBoost *boost, const Unit *source) { StaticSound *sound= this->getType()->getFirstStOfClass(scDie)->getSound(); if(sound != NULL && (this->getFactionIndex() == Unit::game->getWorld()->getThisFactionIndex() || - (game->getWorld()->getThisTeamIndex() == GameConstants::maxPlayers -1 + fpt_Observer))) { + (game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true))) { SoundRenderer::getInstance().playFx(sound); } @@ -2032,7 +2032,7 @@ void Unit::tick() { StaticSound *sound= this->getType()->getFirstStOfClass(scDie)->getSound(); if(sound != NULL && (this->getFactionIndex() == Unit::game->getWorld()->getThisFactionIndex() || - (game->getWorld()->getThisTeamIndex() == GameConstants::maxPlayers -1 + fpt_Observer))) { + (game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true))) { SoundRenderer::getInstance().playFx(sound); } } @@ -2056,7 +2056,7 @@ void Unit::tick() { StaticSound *sound= this->getType()->getFirstStOfClass(scDie)->getSound(); if(sound != NULL && (this->getFactionIndex() == Unit::game->getWorld()->getThisFactionIndex() || - (game->getWorld()->getThisTeamIndex() == GameConstants::maxPlayers -1 + fpt_Observer))) { + (game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true))) { SoundRenderer::getInstance().playFx(sound); } } diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index df523ebd..704c3b75 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -126,7 +126,7 @@ void UnitUpdater::updateUnit(Unit *unit) { float soundStartTime= currSkill->getSoundStartTime(); if(soundStartTime >= unit->getLastAnimProgress() && soundStartTime < unit->getAnimProgress()) { if(map->getSurfaceCell(Map::toSurfCoords(unit->getPos()))->isVisible(world->getThisTeamIndex()) || - (game->getWorld()->getThisTeamIndex() == GameConstants::maxPlayers -1 + fpt_Observer)) { + (game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true)) { soundRenderer.playFx(currSkill->getSound(), unit->getCurrVector(), gameCamera->getPos()); } } @@ -806,7 +806,7 @@ void UnitUpdater::updateBuild(Unit *unit, int frameIndex) { //play start sound if(unit->getFactionIndex() == world->getThisFactionIndex() || - (game->getWorld()->getThisTeamIndex() == GameConstants::maxPlayers -1 + fpt_Observer)) { + (game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true)) { SoundRenderer::getInstance().playFx( bct->getStartSound(), unit->getCurrVector(), @@ -878,7 +878,7 @@ void UnitUpdater::updateBuild(Unit *unit, int frameIndex) { builtUnit->born(); scriptManager->onUnitCreated(builtUnit); if(unit->getFactionIndex() == world->getThisFactionIndex() || - (game->getWorld()->getThisTeamIndex() == GameConstants::maxPlayers -1 + fpt_Observer)) { + (game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true)) { SoundRenderer::getInstance().playFx( bct->getBuiltSound(), unit->getCurrVector(),