mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +02:00
* New files for lib: CBattleCallback.cpp and CBattleCallback.h
* Updated MSVC project files * Filesystem: My version of .SND archive does not have \0 after WAV extension. Fixed (though hardcoded 3-char extension length). * New bonus types: BLOCK_MAGIC_ABOVE for blocking casting spells above given level and BLOCK_ALL_MAGIC for blocking all magic. * Heavy rewrite of battle callbacks. Fixed some minor bugs. Code reusage between lib/client/server (removed proxy calls). Better access control and support for various perspectives. * Fixed #1031 * Fixed Orb of Inhibition and Recanter's Cloak (they were incorrectly implemented). Fixed #97. * Fleeing hero won't lose artifacts. Spellbook won't be captured. Fixed #980. * Fixed crash when attacking stack dies before counterattack (ie. because of Fire Shield) * Server does some basic checks if action requests during battle are valid * Minor stuff.
This commit is contained in:
@ -161,11 +161,11 @@ void CLodArchiveLoader::initSNDArchive(CFileInputStream & fileStream)
|
||||
SoundEntryBlock sndEntry = sndEntries[i];
|
||||
ArchiveEntry entry;
|
||||
|
||||
//for some reason entries in snd have format NAME\0WAV\0\0\0....
|
||||
//we need to replace first \0 with dot and trim line
|
||||
//for some reason entries in snd have format NAME\0WAVRUBBISH....
|
||||
//we need to replace first \0 with dot and take the 3 chars with extension (and drop the rest)
|
||||
entry.name = std::string(sndEntry.filename, 40);
|
||||
entry.name.resize(entry.name.find_first_of('\0') + 4); //+4 because we take dot and 3-char extension
|
||||
entry.name[entry.name.find_first_of('\0')] = '.';
|
||||
entry.name.resize(entry.name.find_first_of('\0'));
|
||||
|
||||
entry.offset = SDL_SwapLE32(sndEntry.offset);
|
||||
entry.realSize = SDL_SwapLE32(sndEntry.size);
|
||||
|
Reference in New Issue
Block a user