Add more descriptive error messages

This commit is contained in:
Ivan Savenko committed 2024-05-16 08:03:06 +00:00
1 parent ff0d5d63d9
commit f963b827e9
1 file changed
+6
+6
View File
@@ -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)