1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00
Version set to 0.93.
This commit is contained in:
Michał W. Urbańczyk 2013-05-31 22:23:53 +00:00
parent 1c0ccd2b02
commit f19e41d38c
4 changed files with 34 additions and 6 deletions

View File

@ -27,7 +27,7 @@
#include "mapping/CCampaignHandler.h" //for CCampaignState
#include "rmg/CMapGenerator.h" // for CMapGenOptions
const ui32 version = 740;
const ui32 version = 741;
class CConnection;
class CGObjectInstance;

View File

@ -14,7 +14,7 @@
namespace GameConstants
{
const std::string VCMI_VERSION = "VCMI 0.92c";
const std::string VCMI_VERSION = "VCMI 0.93";
const int BFIELD_WIDTH = 17;
const int BFIELD_HEIGHT = 11;

View File

@ -942,6 +942,21 @@ struct RebalanceStacks : CGarrisonOperationPack //526
typedef boost::variant<ConstTransitivePtr<CGHeroInstance>, ConstTransitivePtr<CStackInstance> > TArtHolder;
struct GetEngagedHeroIds : boost::static_visitor<boost::optional<ObjectInstanceID>>
{
boost::optional<ObjectInstanceID> operator()(const ConstTransitivePtr<CGHeroInstance> &h) const
{
return h->id;
}
boost::optional<ObjectInstanceID> operator()(const ConstTransitivePtr<CStackInstance> &s) const
{
if(s->armyObj && s->armyObj->ID == Obj::HERO)
return s->armyObj->id;
return boost::optional<ObjectInstanceID>();
}
};
//struct GetArtifactSet : boost::static_visitor<>
//{
// void operator()(const ConstTransitivePtr<CGHeroInstance> &h) const {}

View File

@ -258,14 +258,27 @@ CGarrisonDialogQuery::CGarrisonDialogQuery(const CArmedInstance *up, const CArme
bool CGarrisonDialogQuery::blocksPack(const CPack *pack) const
{
std::set<ObjectInstanceID> ourIds, idsAttempted;
ourIds.insert(this->exchangingArmies[0]->id);
ourIds.insert(this->exchangingArmies[1]->id);
if(auto stacks = dynamic_cast<const ArrangeStacks*>(pack))
{
std::set<ObjectInstanceID> ourIds;
ourIds.insert(this->exchangingArmies[0]->id);
ourIds.insert(this->exchangingArmies[1]->id);
return !vstd::contains(ourIds, stacks->id1) || !vstd::contains(ourIds, stacks->id2);
}
else if(auto arts = dynamic_cast<const ExchangeArtifacts*>(pack))
{
if(auto id1 = boost::apply_visitor(GetEngagedHeroIds(), arts->src.artHolder))
if(!vstd::contains(ourIds, *id1))
return true;
if(auto id2 = boost::apply_visitor(GetEngagedHeroIds(), arts->dst.artHolder))
if(!vstd::contains(ourIds, *id2))
return true;
return false;
}
return CDialogQuery::blocksPack(pack);
}