mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-23 00:28:08 +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 <boost/foreach.hpp>
|
||||||
#include "CSoundBase.h"
|
#include "CSoundBase.h"
|
||||||
#include "../lib/CGameState.h"
|
#include "../lib/CGameState.h"
|
||||||
|
#include "CMusicHandler.h"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning (disable : 4355)
|
#pragma warning (disable : 4355)
|
||||||
@ -1449,6 +1450,7 @@ void CAdvMapInt::select(const CArmedInstance *sel, bool centerView /*= true*/)
|
|||||||
assert(sel);
|
assert(sel);
|
||||||
LOCPLINT->cb->setSelection(sel);
|
LOCPLINT->cb->setSelection(sel);
|
||||||
selection = 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)
|
if(centerView)
|
||||||
centerOn(sel);
|
centerOn(sel);
|
||||||
|
|
||||||
@ -1555,9 +1557,10 @@ void CAdvMapInt::startTurn()
|
|||||||
|
|
||||||
void CAdvMapInt::tileLClicked(const int3 &mp)
|
void CAdvMapInt::tileLClicked(const int3 &mp)
|
||||||
{
|
{
|
||||||
if(!LOCPLINT->cb->isVisible(mp))
|
if(!LOCPLINT->cb->isVisible(mp) || !LOCPLINT->makingTurn)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
std::vector < const CGObjectInstance * > bobjs = LOCPLINT->cb->getBlockingObjs(mp), //blocking objects at tile
|
std::vector < const CGObjectInstance * > bobjs = LOCPLINT->cb->getBlockingObjs(mp), //blocking objects at tile
|
||||||
vobjs = LOCPLINT->cb->getVisitableObjs(mp); //visitable objects
|
vobjs = LOCPLINT->cb->getVisitableObjs(mp); //visitable objects
|
||||||
const TerrainTile *tile = LOCPLINT->cb->getTile(mp);
|
const TerrainTile *tile = LOCPLINT->cb->getTile(mp);
|
||||||
|
Reference in New Issue
Block a user