mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +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:
@@ -160,7 +160,7 @@ void CMapGenOptions::setMonsterStrength(EMonsterStrength::EMonsterStrength value
|
||||
void CMapGenOptions::resetPlayersMap()
|
||||
{
|
||||
players.clear();
|
||||
int realPlayersCnt = playersCnt == RANDOM_SIZE ? PlayerColor::PLAYER_LIMIT_I : playersCnt;
|
||||
int realPlayersCnt = playersCnt == RANDOM_SIZE ? static_cast<int>(PlayerColor::PLAYER_LIMIT_I) : playersCnt;
|
||||
int realCompOnlyPlayersCnt = compOnlyPlayersCnt == RANDOM_SIZE ? (PlayerColor::PLAYER_LIMIT_I - realPlayersCnt) : compOnlyPlayersCnt;
|
||||
for(int color = 0; color < (realPlayersCnt + realCompOnlyPlayersCnt); ++color)
|
||||
{
|
||||
@@ -337,7 +337,7 @@ si32 CMapGenOptions::CPlayerSettings::getStartingTown() const
|
||||
|
||||
void CMapGenOptions::CPlayerSettings::setStartingTown(si32 value)
|
||||
{
|
||||
if(value >= -1 && value < static_cast<int>(VLC->townh->towns.size()))
|
||||
if(value >= -1 && value < static_cast<int>(VLC->townh->factions.size()))
|
||||
{
|
||||
startingTown = value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user