mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Merge remote-tracking branch 'remotes/dydzio/CommanderArtifacts2' into develop
This commit is contained in:
@@ -96,6 +96,18 @@ static bool objectBlitOrderSorter(const TerrainTileObject & a, const TerrainTil
|
|||||||
return CMapHandler::compareObjectBlitOrder(a.obj, b.obj);
|
return CMapHandler::compareObjectBlitOrder(a.obj, b.obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct HeroObjectRetriever : boost::static_visitor<const CGHeroInstance *>
|
||||||
|
{
|
||||||
|
const CGHeroInstance * operator()(const ConstTransitivePtr<CGHeroInstance> &h) const
|
||||||
|
{
|
||||||
|
return h;
|
||||||
|
}
|
||||||
|
const CGHeroInstance * operator()(const ConstTransitivePtr<CStackInstance> &s) const
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
CPlayerInterface::CPlayerInterface(PlayerColor Player)
|
CPlayerInterface::CPlayerInterface(PlayerColor Player)
|
||||||
{
|
{
|
||||||
logGlobal->traceStream() << "\tHuman player interface for player " << Player << " being constructed";
|
logGlobal->traceStream() << "\tHuman player interface for player " << Player << " being constructed";
|
||||||
@@ -2518,7 +2530,7 @@ void CPlayerInterface::stacksRebalanced(const StackLocation &src, const StackLoc
|
|||||||
|
|
||||||
void CPlayerInterface::askToAssembleArtifact(const ArtifactLocation &al)
|
void CPlayerInterface::askToAssembleArtifact(const ArtifactLocation &al)
|
||||||
{
|
{
|
||||||
auto hero = dynamic_cast<const CGHeroInstance*>(al.relatedObj());
|
auto hero = boost::apply_visitor(HeroObjectRetriever(), al.artHolder);
|
||||||
if(hero)
|
if(hero)
|
||||||
{
|
{
|
||||||
auto art = hero->getArt(al.slot);
|
auto art = hero->getArt(al.slot);
|
||||||
|
Reference in New Issue
Block a user