mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Removed most of non-const static fields in lib. Reduced header includes.
This commit is contained in:
@@ -33,10 +33,6 @@
|
||||
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
|
||||
std::vector<const CArtifact *> CGTownInstance::merchantArtifacts;
|
||||
std::vector<TradeItemBuy> CGTownInstance::universitySkills;
|
||||
|
||||
|
||||
int CGTownInstance::getSightRadius() const //returns sight distance
|
||||
{
|
||||
auto ret = CBuilding::HEIGHT_NO_TOWER;
|
||||
@@ -772,7 +768,7 @@ std::vector<TradeItemBuy> CGTownInstance::availableItemsIds(EMarketMode mode) co
|
||||
if(mode == EMarketMode::RESOURCE_ARTIFACT)
|
||||
{
|
||||
std::vector<TradeItemBuy> ret;
|
||||
for(const CArtifact *a : merchantArtifacts)
|
||||
for(const CArtifact *a : cb->gameState()->map->townMerchantArtifacts)
|
||||
if(a)
|
||||
ret.push_back(a->getId());
|
||||
else
|
||||
@@ -781,7 +777,7 @@ std::vector<TradeItemBuy> CGTownInstance::availableItemsIds(EMarketMode mode) co
|
||||
}
|
||||
else if ( mode == EMarketMode::RESOURCE_SKILL )
|
||||
{
|
||||
return universitySkills;
|
||||
return cb->gameState()->map->townUniversitySkills;
|
||||
}
|
||||
else
|
||||
return IMarket::availableItemsIds(mode);
|
||||
@@ -1115,12 +1111,6 @@ void CGTownInstance::afterRemoveFromMap(CMap * map)
|
||||
vstd::erase_if_present(map->towns, this);
|
||||
}
|
||||
|
||||
void CGTownInstance::reset()
|
||||
{
|
||||
CGTownInstance::merchantArtifacts.clear();
|
||||
CGTownInstance::universitySkills.clear();
|
||||
}
|
||||
|
||||
void CGTownInstance::serializeJsonOptions(JsonSerializeFormat & handler)
|
||||
{
|
||||
CGObjectInstance::serializeJsonOwner(handler);
|
||||
|
||||
Reference in New Issue
Block a user