mirror of
https://github.com/vcmi/vcmi.git
synced 2025-05-13 22:06:58 +02:00
Add more descriptive error messages
This commit is contained in:
parent
ff0d5d63d9
commit
f963b827e9
@ -392,9 +392,15 @@ void CGameStateCampaign::transferMissingArtifacts(const CampaignTravel & travelO
|
||||
|
||||
auto * donorHero = campaignHeroReplacement.hero;
|
||||
|
||||
if (!donorHero)
|
||||
throw std::runtime_error("Failed to find hero to take artifacts from! Scenario: " + gameState->map->name.toString());
|
||||
|
||||
for (auto const & artLocation : campaignHeroReplacement.transferrableArtifacts)
|
||||
{
|
||||
auto * artifact = donorHero->getArt(artLocation);
|
||||
if (!donorHero)
|
||||
throw std::runtime_error("Failed to find artifacts to transfer to travelling hero! Scenario: " + gameState->map->name.toString());
|
||||
|
||||
artifact->removeFrom(*donorHero, artLocation);
|
||||
|
||||
if (receiver)
|
||||
|
Loading…
x
Reference in New Issue
Block a user