mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-15 20:03:15 +02:00
Fix crash on attempt to access not visible tile
This commit is contained in:
@@ -173,8 +173,10 @@ void MapAudioPlayer::updateMusic()
|
|||||||
{
|
{
|
||||||
if(audioPlaying && playerMakingTurn && currentSelection)
|
if(audioPlaying && playerMakingTurn && currentSelection)
|
||||||
{
|
{
|
||||||
const auto * terrain = LOCPLINT->cb->getTile(currentSelection->visitablePos())->terType;
|
const auto * tile = LOCPLINT->cb->getTile(currentSelection->visitablePos());
|
||||||
CCS->musich->playMusicFromSet("terrain", terrain->getJsonKey(), true, false);
|
|
||||||
|
if (tile)
|
||||||
|
CCS->musich->playMusicFromSet("terrain", tile->terType->getJsonKey(), true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(audioPlaying && enemyMakingTurn)
|
if(audioPlaying && enemyMakingTurn)
|
||||||
|
Reference in New Issue
Block a user