mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
lib now uses shared_ptr for entities. Removed manual memory management.
This commit is contained in:
@@ -296,9 +296,9 @@ void CMapFormatJson::serializeAllowedFactions(JsonSerializeFormat & handler, std
|
||||
|
||||
if(handler.saving)
|
||||
{
|
||||
for(auto faction : VLC->townh->objects)
|
||||
if(faction->town && vstd::contains(value, faction->getId()))
|
||||
temp.insert(faction->getId());
|
||||
for(auto const factionID : VLC->townh->getDefaultAllowed())
|
||||
if(vstd::contains(value, factionID))
|
||||
temp.insert(factionID);
|
||||
}
|
||||
|
||||
handler.serializeLIC("allowedFactions", &FactionID::decode, &FactionID::encode, VLC->townh->getDefaultAllowed(), temp);
|
||||
|
||||
Reference in New Issue
Block a user