mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Merge pull request #3308 from vcmi/improve_treasure_placement
Improve treasure placement
This commit is contained in:
@ -314,7 +314,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;
|
||||
|
Reference in New Issue
Block a user