mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Fix string ID's road/river/terrains
This commit is contained in:
@@ -33,11 +33,8 @@ RoadType * RoadTypeHandler::loadFromJson(
|
||||
RoadType * info = new RoadType;
|
||||
|
||||
info->id = RoadId(index);
|
||||
if (identifier.find(':') == std::string::npos)
|
||||
info->identifier = scope + ":" + identifier;
|
||||
else
|
||||
info->identifier = identifier;
|
||||
|
||||
info->identifier = identifier;
|
||||
info->modScope = scope;
|
||||
info->tilesFilename = json["tilesFilename"].String();
|
||||
info->shortIdentifier = json["shortIdentifier"].String();
|
||||
info->movementCost = json["moveCost"].Integer();
|
||||
@@ -64,9 +61,14 @@ std::vector<bool> RoadTypeHandler::getDefaultAllowed() const
|
||||
return {};
|
||||
}
|
||||
|
||||
std::string RoadType::getJsonKey() const
|
||||
{
|
||||
return modScope + ":" + identifier;
|
||||
}
|
||||
|
||||
std::string RoadType::getNameTextID() const
|
||||
{
|
||||
return TextIdentifier( "road", identifier, "name" ).get();
|
||||
return TextIdentifier( "road", modScope, identifier, "name" ).get();
|
||||
}
|
||||
|
||||
std::string RoadType::getNameTranslated() const
|
||||
@@ -77,6 +79,7 @@ std::string RoadType::getNameTranslated() const
|
||||
RoadType::RoadType():
|
||||
id(Road::NO_ROAD),
|
||||
identifier("empty"),
|
||||
modScope("core"),
|
||||
movementCost(GameConstants::BASE_MOVEMENT_COST)
|
||||
{}
|
||||
VCMI_LIB_NAMESPACE_END
|
||||
|
||||
Reference in New Issue
Block a user