From 9eef5919de127d7922a6fd38c3390656519a0c5e Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 4 Jun 2012 13:27:12 +0200 Subject: [PATCH] Changed: Assign sane type id to temporary sound sheet ids --- code/nel/src/misc/sheet_id.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/nel/src/misc/sheet_id.cpp b/code/nel/src/misc/sheet_id.cpp index 62dc19013..fb2627b5e 100644 --- a/code/nel/src/misc/sheet_id.cpp +++ b/code/nel/src/misc/sheet_id.cpp @@ -206,7 +206,7 @@ bool CSheetId::buildSheetId(const std::string& sheetName) std::map::iterator it = _DevSheetNameToId.find(sheetNameLc); if (it == _DevSheetNameToId.end()) { - uint32 typeId = typeFromFileExtension("sound"); + uint32 typeId = ((1 << (NL_SHEET_ID_TYPE_BITS)) - 1); // nldebug("SHEETID: Creating a temporary sheet id for '%s'", sheetName.c_str()); _DevSheetIdToName[0].push_back(sheetName); _Id.IdInfos.Type = typeId; @@ -376,7 +376,8 @@ void CSheetId::init(bool removeUnknownSheet) if (typeFromFileExtension("sound") == std::numeric_limits::max()) { nlwarning("SHEETID: Loading without known sound sheet id, please update sheet_id.bin with .sound sheets"); - _FileExtensions.push_back("sound"); + nlassert(_FileExtensions.size() == 1 << (NL_SHEET_ID_TYPE_BITS)); + _FileExtensions[((1 << (NL_SHEET_ID_TYPE_BITS)) - 1)] == "sound"; _DevSheetIdToName.push_back(std::vector()); a_NoSoundSheetId = true; } @@ -512,7 +513,7 @@ string CSheetId::toString(bool ifNotFoundUseNumericId) const else { #ifdef NL_TEMP_YUBO_NO_SOUND_SHEET_ID - if (a_NoSoundSheetId && _FileExtensions[_Id.IdInfos.Type] == "sound") + if (a_NoSoundSheetId && _Id.IdInfos.Type == ((1 << (NL_SHEET_ID_TYPE_BITS)) - 1)) { return _DevSheetIdToName[0][_Id.IdInfos.Id]; }