Browse Source

* Playing terrain music
* Fixed crash on l-clicking advmap during AI turn

Michał W. Urbańczyk 14 years ago
parent
commit
583f37bf1f
1 changed files with 4 additions and 1 deletions
  1. 4 1
      client/CAdvmapInterface.cpp

+ 4 - 1
client/CAdvmapInterface.cpp

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