1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Fix for choosing most specific templates. Also seems to fix the Prisons.

This commit is contained in:
Tomasz Zieliński
2023-12-21 09:58:39 +01:00
parent ad82eff225
commit e22f6dd07e
5 changed files with 36 additions and 13 deletions

View File

@ -315,7 +315,10 @@ TObjectTypeHandler CObjectClassesHandler::getHandlerFor(MapObjectID type, MapObj
if (objects.at(type.getNum()) == nullptr)
return objects.front()->objects.front();
auto result = objects.at(type.getNum())->objects.at(subtype.getNum());
auto subID = subtype.getNum();
if (type == Obj::PRISON)
subID = 0;
auto result = objects.at(type.getNum())->objects.at(subID);
if (result != nullptr)
return result;