1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Large changeset, first part of editing H3 objects via mods feature. Changes:

- loading of all objects (including H3 objects) will be directed by mod handlers
- common base for all handlers accessible from mod system (IHanderBase)
- json format changes: use struct with string ID's instead of vector

- fixed some gcc/clang errors and warnings
- fixed several cases of memory leaks and invalid memory access (mostly related to usage of bonus system and/or identifiers resolution)

Note that right now loading is much slower than before due to excessive json validation (or not fast enough validator)
This commit is contained in:
Ivan Savenko
2013-04-21 12:49:26 +00:00
parent 8a4f81b981
commit c6cc6e6301
85 changed files with 4714 additions and 4441 deletions

View File

@@ -256,7 +256,7 @@ template DLL_LINKAGE void CPrivilagedInfoCallback::loadCommonState<CLoadIntegrit
template DLL_LINKAGE void CPrivilagedInfoCallback::loadCommonState<CLoadFile>(CLoadFile&);
template DLL_LINKAGE void CPrivilagedInfoCallback::saveCommonState<CSaveFile>(CSaveFile&) const;
inline TerrainTile * CNonConstInfoCallback::getTile( int3 pos )
TerrainTile * CNonConstInfoCallback::getTile( int3 pos )
{
if(!gs->map->isInTheMap(pos))
return NULL;
@@ -274,7 +274,7 @@ const CTown * CGameInfoCallback::getNativeTown(PlayerColor color) const
{
const PlayerSettings *ps = getPlayerSettings(color);
ERROR_RET_VAL_IF(!ps, "There is no such player!", NULL);
return &VLC->townh->towns[ps->castle];
return VLC->townh->factions[ps->castle]->town;
}
const CGObjectInstance * CGameInfoCallback::getObjByQuestIdentifier(int identifier) const
@@ -900,7 +900,6 @@ CGHeroInstance *CNonConstInfoCallback::getHero(ObjectInstanceID objid)
CGTownInstance *CNonConstInfoCallback::getTown(ObjectInstanceID objid)
{
return const_cast<CGTownInstance*>(CGameInfoCallback::getTown(objid));
}