1
0
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:
Michał W. Urbańczyk
2011-08-17 21:48:12 +00:00
parent a043bfa44a
commit 583f37bf1f

View File

@ -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);