1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

- gcc 4.5 compatibility

This commit is contained in:
Ivan Savenko 2012-11-02 20:08:37 +00:00
parent 347bfde310
commit 2cd774fe42
4 changed files with 5 additions and 6 deletions

View File

@ -527,7 +527,7 @@ void CArtHandler::getAllowedArts(std::vector<ConstTransitivePtr<CArtifact> > &ou
}
}
Bonus *createBonus(Bonus::BonusType type, int val, int subtype, int valType, shared_ptr<ILimiter> limiter = nullptr, int additionalInfo = 0)
Bonus *createBonus(Bonus::BonusType type, int val, int subtype, int valType, shared_ptr<ILimiter> limiter = shared_ptr<ILimiter>(), int additionalInfo = 0)
{
Bonus *added = new Bonus(Bonus::PERMANENT,type,Bonus::ARTIFACT,val,-1,subtype);
added->additionalInfo = additionalInfo;
@ -536,7 +536,7 @@ Bonus *createBonus(Bonus::BonusType type, int val, int subtype, int valType, sha
return added;
}
Bonus *createBonus(Bonus::BonusType type, int val, int subtype, shared_ptr<IPropagator> propagator = nullptr, int additionalInfo = 0)
Bonus *createBonus(Bonus::BonusType type, int val, int subtype, shared_ptr<IPropagator> propagator = shared_ptr<IPropagator>(), int additionalInfo = 0)
{
Bonus *added = new Bonus(Bonus::PERMANENT,type,Bonus::ARTIFACT,val,-1,subtype);
added->additionalInfo = additionalInfo;

View File

@ -198,7 +198,7 @@ public:
class DLL_LINKAGE CArtHandler //handles artifacts
{
void giveArtBonus(TArtifactID aid, Bonus::BonusType type, int val, int subtype = -1, int valType = Bonus::BASE_NUMBER, shared_ptr<ILimiter> limiter = NULL, int additionalinfo = 0);
void giveArtBonus(TArtifactID aid, Bonus::BonusType type, int val, int subtype = -1, int valType = Bonus::BASE_NUMBER, shared_ptr<ILimiter> limiter = shared_ptr<ILimiter>(), int additionalinfo = 0);
void giveArtBonus(TArtifactID aid, Bonus::BonusType type, int val, int subtype, shared_ptr<IPropagator> propagator, int additionalinfo = 0);
void giveArtBonus(TArtifactID aid, Bonus *bonus);
public:

View File

@ -1042,11 +1042,11 @@ DLL_LINKAGE void UnparseBonus( JsonNode &node, const Bonus * bonus )
node["effectRange"].String() = reverseMapFirst<std::string, int>(bonus->effectRange, bonusLimitEffect);
node["duration"].String() = reverseMapFirst<std::string, int>(bonus->duration, bonusDurationMap);
node["source"].String() = reverseMapFirst<std::string, int>(bonus->source, bonusSourceMap);
if(bonus->limiter != nullptr)
if(bonus->limiter)
{
node["limiter"].String() = reverseMapFirst<std::string, TLimiterPtr>(bonus->limiter, bonusLimiterMap);
}
if(bonus->propagator != nullptr)
if(bonus->propagator)
{
node["propagator"].String() = reverseMapFirst<std::string, TPropagatorPtr>(bonus->propagator, bonusPropagatorMap);
}

View File

@ -103,6 +103,5 @@ struct StartInfo
{
mapfileChecksum = seedPostInit = seedToBeUsed = 0;
mode = INVALID;
campState = nullptr;
}
};