mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
Survive giving Commander's badge to stacks
Used to SEGFAULT
This commit is contained in:
parent
79c85be93f
commit
220e4d2030
@ -2512,7 +2512,14 @@ void CPlayerInterface::askToAssembleArtifact(const ArtifactLocation &al)
|
||||
auto hero = dynamic_cast<const CGHeroInstance*>(al.relatedObj());
|
||||
if (hero)
|
||||
{
|
||||
CArtPlace::askToAssemble(hero->getArt(al.slot), al.slot, hero);
|
||||
auto art = hero->getArt(al.slot);
|
||||
if (art == nullptr)
|
||||
{
|
||||
logGlobal->error("artifact location %d points to nothing",
|
||||
al.slot.num);
|
||||
return;
|
||||
}
|
||||
CArtPlace::askToAssemble(art, al.slot, hero);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -214,6 +214,8 @@ void CArtPlace::clickLeft(tribool down, bool previousState)
|
||||
bool CArtPlace::askToAssemble(const CArtifactInstance *art, ArtifactPosition slot,
|
||||
const CGHeroInstance *hero)
|
||||
{
|
||||
assert(art != nullptr);
|
||||
assert(hero != nullptr);
|
||||
std::vector<const CArtifact *> assemblyPossibilities = art->assemblyPossibilities(hero);
|
||||
|
||||
// If the artifact can be assembled, display dialog.
|
||||
|
Loading…
Reference in New Issue
Block a user