1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Fixed minor issues discovered during testing

This commit is contained in:
Ivan Savenko
2023-03-02 16:08:02 +02:00
parent 165f6a0944
commit b61cae5b37
4 changed files with 8 additions and 9 deletions

View File

@@ -274,7 +274,6 @@ void CSoundHandler::ambientUpdateChannels(std::map<std::string, int> soundsArg)
{ {
int volume = ambientDistToVolume(soundsArg[pair.first]); int volume = ambientDistToVolume(soundsArg[pair.first]);
CCS->soundh->setChannelVolume(pair.second, volume); CCS->soundh->setChannelVolume(pair.second, volume);
logGlobal->info("playing sound %s at %d", pair.first, volume);
} }
} }
for(auto soundId : stoppedSounds) for(auto soundId : stoppedSounds)
@@ -289,7 +288,6 @@ void CSoundHandler::ambientUpdateChannels(std::map<std::string, int> soundsArg)
CCS->soundh->setChannelVolume(channel, volume); CCS->soundh->setChannelVolume(channel, volume);
CCS->soundh->ambientChannels.insert(std::make_pair(pair.first, channel)); CCS->soundh->ambientChannels.insert(std::make_pair(pair.first, channel));
logGlobal->info("playing sound %s at %d", pair.first, volume);
} }
} }
} }
@@ -488,8 +486,10 @@ void CMusicHandler::musicFinishedCallback()
return; return;
} }
else else
{
current.reset(); current.reset();
} }
}
if (current.get() == nullptr && next.get() != nullptr) if (current.get() == nullptr && next.get() != nullptr)
{ {
@@ -514,7 +514,7 @@ MusicEntry::MusicEntry(CMusicHandler *owner, std::string setName, std::string mu
} }
MusicEntry::~MusicEntry() MusicEntry::~MusicEntry()
{ {
if (playing) if (playing && loop > 0)
{ {
assert(0); assert(0);
logGlobal->error("Attempt to delete music while playing!"); logGlobal->error("Attempt to delete music while playing!");

View File

@@ -194,6 +194,7 @@ MapAudioPlayer::MapAudioPlayer()
objects.resize(boost::extents[mapSize.z][mapSize.x][mapSize.y]); objects.resize(boost::extents[mapSize.z][mapSize.x][mapSize.y]);
for(const auto & obj : CGI->mh->getMap()->objects) for(const auto & obj : CGI->mh->getMap()->objects)
if (obj)
addObject(obj); addObject(obj);
} }

View File

@@ -101,8 +101,6 @@ void MapViewController::update(uint32_t timeDelta)
static const double fadeInDuration = 500; static const double fadeInDuration = 500;
static const double heroTeleportDuration = 250; static const double heroTeleportDuration = 250;
//FIXME: remove code duplication?
if(movementContext) if(movementContext)
{ {
const auto * object = context->getObject(movementContext->target); const auto * object = context->getObject(movementContext->target);