1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

Use CompoundMapObjectID in ObjectInfo

This commit is contained in:
Tomasz Zieliński
2024-09-14 09:23:28 +02:00
parent 9591ce1ab4
commit 4d4538a48d
5 changed files with 54 additions and 47 deletions

View File

@ -32,16 +32,12 @@ void ObjectConfig::addBannedObject(const CompoundMapObjectID & objid)
void ObjectConfig::addCustomObject(const ObjectInfo & object, const CompoundMapObjectID & objid)
{
// FIXME: Need id / subId
// FIXME: Add templates and possibly other info
customObjects.push_back(object);
auto & lastObject = customObjects.back();
lastObject.setAllTemplates(objid.primaryID, objid.secondaryID);
assert(lastObject.templates.size() > 0);
auto temp = lastObject.templates.front();
logGlobal->info("Added custom object of type %d.%d", temp->id, temp->subid);
logGlobal->info("Added custom object of type %d.%d", objid.primaryID, objid.secondaryID);
}
void ObjectConfig::serializeJson(JsonSerializeFormat & handler)
@ -154,7 +150,7 @@ void ObjectConfig::serializeJson(JsonSerializeFormat & handler)
VLC->objtypeh->resolveObjectCompoundId(objectName,
[this, objectValue, objectProbability, objectMaxPerZone](CompoundMapObjectID objid)
{
ObjectInfo object;
ObjectInfo object(objid.primaryID, objid.secondaryID);
// TODO: Configure basic generateObject function