mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Place proper towns in underground (#743)
Implement feature of proper town selection in underground and surface * Some minor refactoring of rmg
This commit is contained in:
@@ -211,6 +211,7 @@ CFaction::CFaction()
|
||||
town = nullptr;
|
||||
index = 0;
|
||||
alignment = EAlignment::NEUTRAL;
|
||||
preferUndergroundPlacement = false;
|
||||
}
|
||||
|
||||
CFaction::~CFaction()
|
||||
@@ -1099,6 +1100,9 @@ CFaction * CTownHandler::loadFromJson(const std::string & scope, const JsonNode
|
||||
int terrainNum = nativeTerrain.isNull()
|
||||
? -1
|
||||
: vstd::find_pos(GameConstants::TERRAIN_NAMES, nativeTerrain.String());
|
||||
|
||||
auto preferUndergound = source["preferUndergroundPlacement"];
|
||||
faction->preferUndergroundPlacement = preferUndergound.isNull() ? false : preferUndergound.Bool();
|
||||
|
||||
//Contructor is not called here, but operator=
|
||||
faction->nativeTerrain = terrainNum < 0
|
||||
|
||||
Reference in New Issue
Block a user