mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
* Playing terrain music
* Fixed crash on l-clicking advmap during AI turn
This commit is contained in:
@ -32,6 +32,7 @@
|
||||
#include <boost/foreach.hpp>
|
||||
#include "CSoundBase.h"
|
||||
#include "../lib/CGameState.h"
|
||||
#include "CMusicHandler.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (disable : 4355)
|
||||
@ -1449,6 +1450,7 @@ void CAdvMapInt::select(const CArmedInstance *sel, bool centerView /*= true*/)
|
||||
assert(sel);
|
||||
LOCPLINT->cb->setSelection(sel);
|
||||
selection = sel;
|
||||
CCS->musich->playMusic(CCS->musich->terrainMusics[LOCPLINT->cb->getTile(sel->visitablePos())->tertype]); //TODO: needs to be updated upon hero movement
|
||||
if(centerView)
|
||||
centerOn(sel);
|
||||
|
||||
@ -1555,9 +1557,10 @@ void CAdvMapInt::startTurn()
|
||||
|
||||
void CAdvMapInt::tileLClicked(const int3 &mp)
|
||||
{
|
||||
if(!LOCPLINT->cb->isVisible(mp))
|
||||
if(!LOCPLINT->cb->isVisible(mp) || !LOCPLINT->makingTurn)
|
||||
return;
|
||||
|
||||
|
||||
std::vector < const CGObjectInstance * > bobjs = LOCPLINT->cb->getBlockingObjs(mp), //blocking objects at tile
|
||||
vobjs = LOCPLINT->cb->getVisitableObjs(mp); //visitable objects
|
||||
const TerrainTile *tile = LOCPLINT->cb->getTile(mp);
|
||||
|
Reference in New Issue
Block a user