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