mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
* WIP on event condition format
* Hero portrait serialization * Fix town spells serialization * Added support for float exponential part in Json * Added support for int64 in Json * Added basic Hero definitions serialization * Added rumors serialization * Advanced player info serialization. * Added Disposed heroes serialization, (!) not covered with tests yet * Added Local event serialization * Added Pandoras box serialization * Added Seer hut reward serialization * Added CQuest serialization * Added API for map object instance names serialization. * Added random dwelling options serialization * Advanced town options serialization * Advanced hero options serialization * More map format tests * A lot of fixes, cleanup and refactoring
This commit is contained in:
@@ -99,8 +99,16 @@ const CTown * CGameInfoCallback::getNativeTown(PlayerColor color) const
|
||||
|
||||
const CGObjectInstance * CGameInfoCallback::getObjByQuestIdentifier(int identifier) const
|
||||
{
|
||||
ERROR_RET_VAL_IF(!vstd::contains(gs->map->questIdentifierToId, identifier), "There is no object with such quest identifier!", nullptr);
|
||||
return getObj(gs->map->questIdentifierToId[identifier]);
|
||||
if(gs->map->questIdentifierToId.empty())
|
||||
{
|
||||
//assume that it is VCMI map and quest identifier equals instance identifier
|
||||
return getObj(ObjectInstanceID(identifier), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ERROR_RET_VAL_IF(!vstd::contains(gs->map->questIdentifierToId, identifier), "There is no object with such quest identifier!", nullptr);
|
||||
return getObj(gs->map->questIdentifierToId[identifier]);
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user