mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-23 00:28:08 +02:00
Support for configurable town fortifications
Removed most of hardcoded checks for fort level or for presence of fort/ citadel/castle buildings. It is now possible to define which parts of town fortifications are provided by town buildings Configuration for H3-like fortifications is provided in buildingsLibrary.json and will be used automatically by mods as long as mods have buidings named "fort", "citadel" and "castle". Alternatively, mods can separately define: - hitpoints of walls (shared value for all sections) - hitpoints of central, upper and lower towers (separate values) - presence of moat - shooters for each tower (separate values)
This commit is contained in:
@ -190,6 +190,12 @@ void CIdentifierStorage::requestIdentifier(const JsonNode & name, const std::fun
|
||||
requestIdentifier(ObjectCallback::fromNameWithType(name.getModScope(), name.String(), callback, false));
|
||||
}
|
||||
|
||||
void CIdentifierStorage::requestIdentifierOptional(const std::string & type, const JsonNode & name, const std::function<void(si32)> & callback) const
|
||||
{
|
||||
if (!name.isNull())
|
||||
requestIdentifier(type, name, callback);
|
||||
}
|
||||
|
||||
void CIdentifierStorage::tryRequestIdentifier(const std::string & scope, const std::string & type, const std::string & name, const std::function<void(si32)> & callback) const
|
||||
{
|
||||
requestIdentifier(ObjectCallback::fromNameAndType(scope, type, name, callback, true));
|
||||
|
Reference in New Issue
Block a user