mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +02:00
Removed remaining cases of serialization of VLC entities
This commit is contained in:
@ -359,8 +359,11 @@ public:
|
||||
h & boat;
|
||||
if (h.version < Handler::Version::REMOVE_TOWN_PTR)
|
||||
{
|
||||
CHero * type = nullptr;
|
||||
h & type;
|
||||
HeroTypeID type;
|
||||
bool isNull = false;
|
||||
h & isNull;
|
||||
if(!isNull)
|
||||
h & type;
|
||||
}
|
||||
h & commander;
|
||||
h & visitedObjects;
|
||||
|
@ -68,11 +68,8 @@ std::vector<TradeItemBuy> CGBlackMarket::availableItemsIds(EMarketMode mode) con
|
||||
case EMarketMode::RESOURCE_ARTIFACT:
|
||||
{
|
||||
std::vector<TradeItemBuy> ret;
|
||||
for(const CArtifact *a : artifacts)
|
||||
if(a)
|
||||
ret.push_back(a->getId());
|
||||
else
|
||||
ret.push_back(ArtifactID{});
|
||||
for(const auto & a : artifacts)
|
||||
ret.push_back(a);
|
||||
return ret;
|
||||
}
|
||||
default:
|
||||
|
@ -63,7 +63,7 @@ class DLL_LINKAGE CGBlackMarket : public CGMarket
|
||||
public:
|
||||
using CGMarket::CGMarket;
|
||||
|
||||
std::vector<const CArtifact *> artifacts; //available artifacts
|
||||
std::vector<ArtifactID> artifacts; //available artifacts
|
||||
|
||||
void newTurn(vstd::RNG & rand) const override; //reset artifacts for black market every month
|
||||
std::vector<TradeItemBuy> availableItemsIds(EMarketMode mode) const override;
|
||||
|
@ -670,11 +670,9 @@ std::vector<TradeItemBuy> CGTownInstance::availableItemsIds(EMarketMode mode) co
|
||||
if(mode == EMarketMode::RESOURCE_ARTIFACT)
|
||||
{
|
||||
std::vector<TradeItemBuy> ret;
|
||||
for(const CArtifact *a : cb->gameState()->map->townMerchantArtifacts)
|
||||
if(a)
|
||||
ret.push_back(a->getId());
|
||||
else
|
||||
ret.push_back(ArtifactID{});
|
||||
for(const ArtifactID a : cb->gameState()->map->townMerchantArtifacts)
|
||||
ret.push_back(a);
|
||||
|
||||
return ret;
|
||||
}
|
||||
else if ( mode == EMarketMode::RESOURCE_SKILL )
|
||||
|
@ -114,19 +114,11 @@ public:
|
||||
|
||||
if (h.version < Handler::Version::REMOVE_TOWN_PTR)
|
||||
{
|
||||
CTown * town = nullptr;
|
||||
|
||||
if (h.saving)
|
||||
{
|
||||
CFaction * faction = town ? town->faction : nullptr;
|
||||
FactionID faction;
|
||||
bool isNull = false;
|
||||
h & isNull;
|
||||
if (!isNull)
|
||||
h & faction;
|
||||
}
|
||||
else
|
||||
{
|
||||
CFaction * faction = nullptr;
|
||||
h & faction;
|
||||
town = faction ? faction->town : nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
h & townAndVis;
|
||||
|
Reference in New Issue
Block a user