Fix error in start/stop music

This commit is contained in:
Eduardo Bart 2012-07-17 22:22:21 -03:00
parent eb24d6776e
commit cb1848d48d
3 changed files with 5 additions and 13 deletions

View File

@ -29,6 +29,7 @@
#include <framework/core/clock.h>
#include <framework/core/eventdispatcher.h>
#include <framework/core/resourcemanager.h>
SoundManager g_sounds;
@ -163,7 +164,7 @@ void SoundManager::playMusic(const std::string& filename, float fadetime)
{
if(m_currentMusic == filename && m_musicSource)
return;
m_currentMusic = filename;
m_currentMusic = g_resources.resolvePath(filename);
if(!m_musicEnabled)
return;

View File

@ -47,6 +47,7 @@ private:
Boolean<false> m_loaded;
uint32 m_signature;
int m_spritesCount;
int m_spritesOffset;
FileStreamPtr m_spritesFile;
};

View File

@ -47,11 +47,6 @@ void ThingTypeDat::unserialize(uint16 clientId, DatCategory category, const File
m_id = clientId;
m_category = category;
static int datVersion;
if(clientId == 100 && category == DatItemCategory)
datVersion = 2;
bool done = false;
for(int i = 0 ; i < DatLastAttrib;++i) {
int attrib = fin->getU8();
@ -60,12 +55,7 @@ void ThingTypeDat::unserialize(uint16 clientId, DatCategory category, const File
break;
}
// hacky way to detect if is older dat version or not
if(clientId == 100 && category == DatItemCategory && datVersion != 1 &&
(attrib == DatAttribNotPathable || attrib == DatAttribDontHide || attrib == DatAttribIgnoreLook)) {
datVersion = 1;
}
if(datVersion <= 1) {
if(g_game.getFeature(Otc::GameChargeableItems)) {
if(attrib == DatAttribWritable) {
m_attribs.set(DatAttribChargeable, true);
continue;
@ -135,7 +125,7 @@ void ThingTypeDat::unserialize(uint16 clientId, DatCategory category, const File
m_spritesIndex.resize(totalSprites);
for(int i = 0; i < totalSprites; i++)
m_spritesIndex[i] = fin->getU16();
m_spritesIndex[i] = g_game.getFeature(Otc::GameSpritesU32) ? fin->getU32() : fin->getU16();
m_textures.resize(m_animationPhases);
m_texturesFramesRects.resize(m_animationPhases);