1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fix regressions in RMG & map editor

This commit is contained in:
Ivan Savenko 2023-01-10 01:30:01 +02:00
parent d0fe875cc6
commit b13637cdd5
2 changed files with 4 additions and 1 deletions

View File

@ -372,7 +372,7 @@ std::string CObjectClassesHandler::getObjectName(si32 type, si32 subtype) const
SObjectSounds CObjectClassesHandler::getObjectSounds(si32 type, si32 subtype) const
{
if(type == Obj::PRISON || type == Obj::HERO)
if(type == Obj::PRISON || type == Obj::HERO || type == Obj::SPELL_SCROLL)
subtype = 0;
assert(type < objects.size());

View File

@ -468,6 +468,9 @@ void MainWindow::addGroupIntoCatalog(const std::string & groupName, bool useCust
itemGroup = itms.front();
}
if (VLC->objtypeh->knownObjects().count(ID) == 0)
return;
auto knownSubObjects = VLC->objtypeh->knownSubObjects(ID);
for(auto secondaryID : knownSubObjects)
{